Created
September 5, 2021 15:53
-
-
Save AlanPew/48bf25c0827f5a6c379381251b74fb49 to your computer and use it in GitHub Desktop.
esri js test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>ArcGIS Developer Guide: Display a map (2D)</title> | |
<style> | |
html, | |
body, | |
#viewDiv { | |
padding: 0; | |
margin: 0; | |
height: 100%; | |
width: 100%; | |
} | |
</style> | |
<link rel="stylesheet" href="https://js.arcgis.com/4.19/esri/themes/light/main.css"> | |
<script src="https://js.arcgis.com/4.19/"></script> | |
<script> | |
require([ | |
"esri/config", | |
"esri/Map", | |
"esri/views/MapView" | |
], function (esriConfig,Map, MapView) { | |
esriConfig.apiKey = "AAPK40227465b1fb4bb09182247cf1beb820xRhOp5k4k_gXM_rcN7UzsO-jpL9fDVFJxl1mW-2VUfNv0yCL81xh5yd7ydX-xIJd"; | |
const map = new Map({ | |
basemap: "arcgis-topographic" // Basemap layer | |
}); | |
const view = new MapView({ | |
map: map, | |
center: [-118.805, 34.027], | |
zoom: 13, // scale: 72223.819286 | |
container: "viewDiv", | |
constraints: { | |
snapToZoom: false | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment