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

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:

主站蜘蛛池模板: 蓬安县| 定远县| 安乡县| 大安市| 黄山市| 运城市| 浦城县| 五华县| 蕉岭县| 大足县| 陕西省| 尼勒克县| 双牌县| 乃东县| 余庆县| 富源县| 蕲春县| 谢通门县| 新源县| 德格县| 台东市| 班戈县| 宁津县| 武宁县| 汪清县| 柞水县| 长泰县| 永清县| 雷山县| 苏尼特右旗| 江永县| 五华县| 合江县| 日土县| 积石山| 儋州市| 锦屏县| 乐东| 汤原县| 青阳县| 安义县|