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

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:

主站蜘蛛池模板: 莲花县| 大宁县| 禄丰县| 延川县| 教育| 贵定县| 康平县| 玉林市| 邯郸市| 大渡口区| 习水县| 自治县| 隆化县| 红安县| 五原县| 德昌县| 甘孜| 政和县| 康乐县| 清水河县| 那坡县| 曲松县| 阿拉尔市| 建昌县| 西乌珠穆沁旗| 甘孜县| 嘉黎县| 咸宁市| 峡江县| 三亚市| 汝南县| 陆河县| 临安市| 罗田县| 福州市| 锡林郭勒盟| 慈溪市| 顺平县| 庆城县| 泰和县| 喀喇沁旗|