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

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:

主站蜘蛛池模板: 冀州市| 商城县| 呼玛县| 锦屏县| 托克逊县| 德格县| 丹凤县| 眉山市| 邳州市| 阿克陶县| 阿坝县| 龙岩市| 右玉县| 密云县| 梁平县| 石景山区| 潍坊市| 天津市| 临城县| 项城市| 连云港市| 西畴县| 新干县| 西宁市| 夏津县| 大姚县| 三门县| 汝阳县| 浏阳市| 柞水县| 永宁县| 阜新| 黎城县| 宁德市| 达拉特旗| 邯郸县| 锡林浩特市| 高青县| 泰州市| 潼关县| 丘北县|