- Building Web and Mobile ArcGIS Server Applications with JavaScript(Second Edition)
- Eric Pimpler Mark Lewin
- 96字
- 2021-07-02 15:48:59
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:

推薦閱讀
- 手機安全和可信應(yīng)用開發(fā)指南:TrustZone與OP-TEE技術(shù)詳解
- Java程序設(shè)計(慕課版)
- 自己動手寫搜索引擎
- Java開發(fā)入行真功夫
- 64位匯編語言的編程藝術(shù)
- 零基礎(chǔ)學(xué)MQL:基于EA的自動化交易編程
- 手把手教你學(xué)C語言
- 名師講壇:Spring實戰(zhàn)開發(fā)(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- Hands-On Full Stack Development with Go
- Flowable流程引擎實戰(zhàn)
- 多模態(tài)數(shù)據(jù)分析:AGI時代的數(shù)據(jù)分析方法與實踐
- Exploring SE for Android
- NGUI for Unity
- Python Social Media Analytics
- HTML5與CSS3權(quán)威指南