标签:
好几个月没用ArcGIS API for JavaScript,去官网看了一下,最新api已经是4.0了,也开始支持3D了,先运行看看吧。
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> 6 <title>Get started with SceneView - Create a 3D map</title> 7 <style> 8 html, body, #viewDiv { 9 padding: 0; 10 margin: 0; 11 height: 100%; 12 width: 100%; 13 } 14 </style> 15 <link rel="stylesheet" href="https://js.arcgis.com/4.0/esri/css/main.css"> 16 <script src="https://js.arcgis.com/4.0/"></script> 17 <script> 18 require([ 19 "esri/Map", 20 "esri/views/SceneView", 21 "dojo/domReady!" 22 ], function(Map, SceneView){ 23 var map = new Map({ 24 basemap: "streets", 25 ground: "world-elevation" 26 }); 27 var view = new SceneView({ 28 container: "viewDiv", // Reference to the scene div created in step 5 29 map: map, // Reference to the map object created before the scene 30 scale: 50000000, // Sets the initial scale to 1:50,000,000 31 center: [-101.17, 21.78] // Sets the center point of view with lon/lat 32 }); 33 }); 34 </script> 35 </head> 36 <body> 37 <div id="viewDiv"></div> 38 </body> 39 </html>
标签:
原文地址:http://www.cnblogs.com/lvmh/p/5838306.html