< HTML > < head > < Meta charset = "UTF-. 8" > < Meta name = "the viewport" Content = "Initial-Scale =. 1, maximum-Scale =. 1, User-Scalable = NO" > < title > the ArcGIS the JavaScript tutorials: a Basemap the Select </ title > < style > / * set the display area pattern, full-page map display * / HTML, body, #viewDiv { padding : 0 ; margin : 0 ; height: 100%; width: 100%; } </style> <! - The first step: introducing js file and css stylesheets, as used herein, the 4.13 version -> < Link rel = "stylesheet" href = "HTTP: //localhost/arcgis_js_v413_api/4.13/esri/css/main. CSS " /> < Script type =" text / JavaScript " the src =" HTTP: //localhost/arcgis_js_v413_api/4.13/init.js " > </ Script > <! - begin using the edit js, load maps to achieve results -> < Script > // The second step, the need to import the module, where the introduction of the Map, the MapView, Compass, MapImageLayer The require ([ " ESRI / the Map " , " ESRI / views / the MapView " , " ESRI / Widgets / Compass " , " ESRI / Layers / MapImageLayer " ], function (the Map, the MapView, Compass, MapImageLayer) { // third step, a map layer initialize var the Layer0 = new new MapImageLayer ({ url: "URL0" }); was layer1 = new MapImageLayer ({ url: "URL1" }); // The fourth step is to initialize a map object var the Map = new new the Map (); map.add(layer0); map.add(layer1); // create a new view, using a MapView, it is in 2D, 3D's use SceneView module, SceneView method creates. var View = new new the MapView ({ // area on display HTML, which is the div Container: " viewDiv " , // load the map service to the view, which is set version 4.x, 3.x version setting can directly create the map the map: the map, // set the zoom level of the map is loaded and center. Center: [ 115.80543 , 36.02700 ], // longitude, Latitude zoom: 6 }); var compassWidget = new Compass({ view: view }); view.ui.add(compassWidget, "top-left"); }); </script> </head> <body> <div id="viewDiv"></div> </body> </html>