書的版本有點老,具體的代碼需要參照官方的文檔
但是,書可以講講怎麼回事~
官網,一言不合就英文
不過,也有中文版哈
嗯嗯~~~ 有中文 !!!
第一章 可以略過
從 第二章 開始
第二章 創建地圖 添加圖層
本文只是 創建地圖
官方的
baseMap的說明文檔~
https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap
官網的沙盤
https://codepen.io/pen?&editable=true&editors=100
其他網友的
https://blog.csdn.net/huyanliang/article/details/73844673
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<!--
ArcGIS API for JavaScript, https://js.arcgis.com
For more information about the intro-mapview sample, read the original sample description at developers.arcgis.com.
https://developers.arcgis.com/javascript/latest/sample-code/intro-mapview/index.html
-->
<title>Intro to MapView - Create a 2D map - 4.15</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.15/esri/themes/light/main.css"
/>
<script src="https://js.arcgis.com/4.15/"></script>
<script>
require(["esri/Map", "esri/views/MapView"], function(Map, MapView) {
var map = new Map({
basemap: "topo"
});
var view = new MapView({
container: "viewDiv",
map: map,
zoom: 12,
center: [117.20, 39.12] // longitude, latitude
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
topo
streets
什麼鬼~~
satellite
hybrid
dark-gray
gray
national-geographic
oceans
osm
要不說 得找呢 這纔是想要的吧 中文的 全的 不是自己翻譯 自己畫的 ~~~
terrain
dark-gray-vector
gray-vector
streets-vector
streets-night-vector
streets-navigation-vector
topo-vector
streets-relief-vector