Skip to content

Instantly share code, notes, and snippets.

@jgravois
Last active June 6, 2020 02:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgravois/b7929100e6fd7ddc8de343771c5a281e to your computer and use it in GitHub Desktop.
Save jgravois/b7929100e6fd7ddc8de343771c5a281e to your computer and use it in GitHub Desktop.
smooth animation in JSAPI 4.x
license: apache-2.0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Get started with MapView - Create a 2D map - 4.4</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.4/esri/css/main.css">
<script src="https://js.arcgis.com/4.4/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"dojo/domReady!"
], function(Map, MapView) {
var map = new Map({
basemap: "streets-navigation-vector"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [15, 65], // longitude, latitude
zoom: 4,
// https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints
constraints: { snapToZoom: false }
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment