前言
本次学习中,
. ArcGIS API for javascript 版本为3.30
. 以AMD模块引入方式编写
创建地图
- 创建一个H5文档
- 引入基础样式 https://js.arcgis.com/3.30/esri/css/esri.css
- 引入基础库 https://js.arcgis.com/3.30/
<!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" href="https://js.arcgis.com/3.30/esri/css/esri.css">
<style>
html, body, #map {
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="https://js.arcgis.com/3.30/"></script>
<script>
var map;
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("map", {
basemap: "topo", // 底图样式
center: [-122.45, 37.75], // 定位坐标点
zoom: 13
});
});
</script>
</head>
<body>
<div id="map"></div>
<ul>
<li>创建一个全屏地图</li>
<li>位置是旧金山</li>
</ul>
</body>
</html>