- Mastering ArcGIS Server Development with JavaScript
- Ken Doman
- 245字
- 2021-07-16 20:03:01
The map object
Now that we have the components, we need to create an interactive map; let's put them together. We'll start by constructing a map
object, which provides the basis and interaction platform that we'll need to work with. The map constructor takes two arguments. The first parameter, either the HTML node or the id
string of a node, indicates where we want to put our map. The second parameter of the map constructor is an options
object, where we add the configurable options that make our map work as expected:
function ( Map, ArcGISDynamicMapServiceLayer, IdentifyParameters, IdentifyTask, InfoTemplate, arrayUtils ) { var map = new Map("map", { basemap: "national-geographic", center: [-95, 45], zoom: 3 }); });
In the preceding code, we're creating a map in the div
element with an id
of map
. In the map, we're adding a basemap, or a background reference map, in the style of National Geographic. We're centering the map at 45°N and 95°W, at a zoom level of three. We'll go into greater depth concerning these configurations in later chapters. If you're using a desktop browser to view the results, you should see the United States, including Alaska, and Hawaii, as in the following image:

- Learning Single:page Web Application Development
- scikit-learn Cookbook
- Windows系統(tǒng)管理與服務(wù)配置
- Java 9 Programming Blueprints
- Mastering Ubuntu Server
- JS全書(shū):JavaScript Web前端開(kāi)發(fā)指南
- 深入淺出PostgreSQL
- WebRTC技術(shù)詳解:從0到1構(gòu)建多人視頻會(huì)議系統(tǒng)
- 碼上行動(dòng):用ChatGPT學(xué)會(huì)Python編程
- Learning OpenStack Networking(Neutron)(Second Edition)
- C專家編程
- OpenCV with Python By Example
- 后臺(tái)開(kāi)發(fā):核心技術(shù)與應(yīng)用實(shí)踐
- 監(jiān)控的藝術(shù):云原生時(shí)代的監(jiān)控框架
- Photoshop CC移動(dòng)UI設(shè)計(jì)案例教程(全彩慕課版·第2版)