Open Street Map
OpenStreetMap (OSM, Chinese is an open street map) is an online map collaboration program that aims to create a world map of content that is free and editable for all.
OSM is a free, open-source, editable map service created by the Internet community. OpenStreetMap It is the use of public collective power and unpaid contributions to improve map-related geographic data. OSM is not-for-profit, and it returns the data back to the community for other products and services. Other maps sell most of the map data to third parties.
The OSM map is drawn by users based on portable GPS devices, aerial photographs, other free content, and even local wisdom alone. The map images and vector data on the site are shared with creative names-sharing 2.0 licenses in the same way.with the Esri/layers/openstreetmaplayer class, open street charts can be used as base basemaps.
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "Utf-8"> <title>Access to open Street map</title> <Linkrel= "stylesheet"href= "Http://js.arcgis.com/3.9/js/esri/css/esri.css"> <style>html, body, #mapDiv{padding:0;margin:0;Height:100%; } /*set Graph to grayscale*/#mapDiv_osmLayer img{Filter:URL (filters.svg#grayscale)!important; /*Firefox 3.5+*/Filter:Gray!important; /*ie5+*/-webkit-filter:Grayscale (1)!important; /*Webkit nightlies & Chrome Canary*/ } </style> <Scriptsrc= "http://js.arcgis.com/3.9/"></Script> <Script>require (["Esri/map", "Esri/layers/openstreetmaplayer", "dojo/domready!"], function(Map, openstreetmaplayer) {//Here's the code for creating maps and adding Basemaps varMap= NewMap ("Mapdiv"); varOSM= NewOpenstreetmaplayer ({ID:'Osmlayer' }); Map.addlayer (OSM); }); </Script></Head><Bodyclass= "Tundra"> <DivID= "Mapdiv"></Div></Body></HTML>
The naming convention for the ArcGIS API for JavaScript to create HTML elements for each layer is "map div id" + "Layer ID", so as we instantiate the Openstreetmaplayer class, we specify the layer's id "Osmlayer" , and the element ID for the map is "Mapdiv", then the element ID for the layer is "Mapdiv_osmlayer".
Implementation results:
ArcGIS API for javascript3.x learning Note [4] loading Basemaps (iii) "Open Street map opening street maps"