<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" />
<!--
ArcGIS API for JavaScript, https://js.arcgis.com
For more information about the layers-vectortilelayer sample,
read the original sample description at developers.arcgis.com.
https://developers.arcgis.com/javascript/latest/sample-code/layers-vectortilelayer/index.html
-->
<title>Geoaccelerators ESRI JavaScript API VectorTileLayer</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.14/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.14/"></script>
<script src="index.js">
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
JavaScript
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/VectorTileLayer"
], function(Map, MapView, VectorTileLayer) {
// Create a Map
const map = new Map();
// Make map view and bind it to the map
const view = new MapView({
container: "viewDiv",
map: map,
//center: [-84.55, 39.2],
zoom: 9
});
/********************************************************************
* Add a vector tile layer to the map
*
* The url must point to the style or the vector tile service
*********************************************************************/
const contours = new VectorTileLayer({
url: "http://localhost:8000/VectorTileServer/"
});
map.add(contours);
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.