1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport"> <title>Intro to MapView - Create a 2D map - 4.8</title> <style> //设置显示区域的样式,地图全页面展示 html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } </style> // 第一步:引入js文件和css样式表,本文使用了4.9版本 <link rel="stylesheet" href="https://js.arcgis.com/4.9/esri/css/main.css"> <script src="https://js.arcgis.com/4.9/"></script> //开始使用编辑js,实现加载地图效果 <script> require([ "esri/Map", "esri/views/MapView" ], function(Map, MapView) { var map = new Map({ basemap: "streets" }); var view = new MapView({ container: "viewDiv", map: map, zoom: 4, center: [15, 65] }); }); </script> </head> <body> <div id="viewDiv"></div> </body> </html>
|