ArcGIS API for JavaScript white entry

 Simple to understand: the method by js arcgis related calls and a map to show the introduction of css and other resources through html, code is as follows:

<! DOCTYPE HTML> 
<HTML> 
<head> 
  <Meta charset = "UTF-. 8"> 
  <Meta name = "the viewport"> 
  <title> Intro to the MapView - the Create A 2D Map - 4.8 </ title> 
  <style> / / style display area is provided, a map showing the whole page 
    HTML, 
    body, 
    #viewDiv { 
      padding: 0; 
      margin: 0; 
      height: 100%; 
      width: 100%; 
    } 
  </ style> 
  //      First step: introducing js file css and style sheets, as used herein, the version 4.9 
  <Link the rel = "this stylesheet" the href = "https://js.arcgis.com/ 4.9 /esri/css/main.css"> 
  <Script the src = "HTTPS: // js.arcgis.com/ 4.9 / "> </ Script> 
  // start using the edit js, load maps to achieve the effect of 
  <Script> 
  //     The second step, the need to import the module, and incorporated herein Map of the MapView 
    the require ([ 
      "ESRI / Map", 
      "ESRI / views / the MapView" 
    ], function (Map, the MapView) { 
  //      third step, a map object initialization 
      the map map new new = var ({ 
        // disposed FIG base type, loads its own map service required. 
        Basemap: "Streets" 
      }); 
       // create a new view, using the MapView, it is to use the SceneView 2D, 3D of module, SceneView method creates. 
      var = new new view the MapView ({ 
       // display area on HTML, which is the div 
        Container: "viewDiv", 
         // load the map service to the view, which is set version 4.x set, 3.x version is set to create a map directly 
        map: map, 
       // set the zoom level of the map is loaded and central location. 
        zoom: 4, 
        Center: [15, 65] // longitude, Latitude 
      });
    });
  </script>
</head>
<body>
  <div id="viewDiv"></div>
</body>
</html>

  

Guess you like

Origin www.cnblogs.com/robinw666/p/11718897.html