Skip to content

Instantly share code, notes, and snippets.

@danmaps
Last active April 4, 2016 14:46
Show Gist options
  • Save danmaps/6f49be719a6c92307e05 to your computer and use it in GitHub Desktop.
Save danmaps/6f49be719a6c92307e05 to your computer and use it in GitHub Desktop.
Vector tiles - 4.0beta3
license: gpl-3.0

JS API 4.0 Beta 3 example from here

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>Vector tiles - 4.0beta3</title>
<style>
html,
body {
padding: 0;
margin: 0;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.0beta3/esri/css/main.css">
<script src="https://js.arcgis.com/4.0beta3/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/VectorTileLayer",
"dojo/domReady!"
], function(Map, MapView, VectorTileLayer) {
//Create a map object
var map = new Map();
//make map view and bind it to the map
var view = new MapView({
container: "viewDiv",
map: map,
center: [-117.1955587, 34.0572461],
zoom: 17
});
var tileLyr = new VectorTileLayer({
url: "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap/VectorTileServer"
});
map.add(tileLyr);
});
</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