ArcGIS API for JavaScript4.x 之加载2D、3D地图

ArcGIS API for JavaScript4.x 之加载2D、3D地图

//html添加地图容器
<body>
  <div id="viewDiv"></div>
</body>
<script>
require([//引入对应模块
  "esri/Map",
  "esri/views/MapView",
  "dojo/domReady!"//dom所有都加载完才执行function中代码
], function(Map, MapView) {
  var map = new Map({
    basemap: "streets"
  });

  var view = new MapView({
    container: "viewDiv",  // map div id
    map: map,              // 绑定map对象
    zoom: 4,  // 初始化缩放级别
    center: [15, 65]  // 初始化中心点
  });
});
</script>

##加载3D地图

<body>
  <div id="viewDiv"></div>
</body>

<script>
require([//引入对应模块
  "esri/Map",
  "esri/views/SceneView",
  "dojo/domReady!"//dom所有都加载完才执行function中代码
], function(Map, MapView) {
  var map = new Map({
    basemap: "streets",//底图可选satellite, hybrid, topo, gray, dark-gray, oceans, osm, national-geographic
    ground: "world-elevation"//针对3维指定海拔
  });

  var view = new SceneView({
    container: "viewDiv",  // 3D地图容器
    map: map,  // 绑定map
    scale: 50000000,          // 海拔 1:50,000,000
    center: [-101.17, 21.78]  //地图中心点
  });
});
</script>

Warning: Division by zero in /var/www/html/giserdqy/wp-includes/comment-template.php on line 1457

发表评论