官术网_书友最值得收藏!

The entire code

The code for this simple application should appear as follows:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>Simple Map</title>
<link rel="stylesheet" >
<style>
html,
body,
#map {
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="https://js.arcgis.com/3.21/"></script>
<script>
var map;
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("map", {
basemap: "topo",
center: [-122.19, 37.94], // longitude, latitude
zoom: 6
});
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>

Execute the code by clicking the Refresh button and you should see the following map if everything has been coded correctly. If your application does not work as expected, check your code against the contents of the basic_map.html file in the Chapter2 folder of the sample code:

主站蜘蛛池模板: 休宁县| 右玉县| 成安县| 东乌| 邳州市| 青岛市| 西平县| 射洪县| 佛山市| 莱芜市| 德昌县| 麻栗坡县| 鄂托克旗| 伽师县| 略阳县| 天全县| 邹平县| 泉州市| 稷山县| 剑河县| 上高县| 武清区| 苍梧县| 琼海市| 苏尼特左旗| 延寿县| 吴堡县| 社旗县| 克山县| 滨州市| 兴义市| 同仁县| 普兰店市| 封丘县| 江孜县| 新乐市| 出国| 通化县| 陕西省| 灵武市| 清涧县|