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

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:

主站蜘蛛池模板: 伊宁市| 治多县| 三穗县| 高安市| 武宣县| 临潭县| 太白县| 福海县| 青铜峡市| 民和| 荃湾区| 中西区| 江华| 吴堡县| 海原县| 恩施市| 县级市| 德昌县| 大理市| 德令哈市| 资中县| 辽阳市| 永宁县| 五寨县| 房山区| 夹江县| 鲁山县| 抚宁县| 白水县| 穆棱市| 文昌市| 工布江达县| 信阳市| 德令哈市| 甘南县| 三都| 井冈山市| 大化| 彝良县| 武强县| 郎溪县|