- 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:

推薦閱讀
- Unreal Engine Physics Essentials
- Mastering Objectoriented Python
- Python 3網(wǎng)絡爬蟲實戰(zhàn)
- Java:Data Science Made Easy
- 數(shù)據(jù)結(jié)構(gòu)(C語言)
- Learning Apache Mahout Classification
- Learning Salesforce Einstein
- 自然語言處理Python進階
- Gradle for Android
- Microsoft Azure Storage Essentials
- 愛上micro:bit
- UNIX Linux程序設計教程
- Processing創(chuàng)意編程指南
- Hands-On Full Stack Development with Spring Boot 2.0 and React
- C編程技巧:117個問題解決方案示例