forked from Esri/Viewer
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathLayers.html
61 lines (54 loc) · 1.68 KB
/
Layers.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!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: [-79.36, 43.65],
zoom:1
});
/********************************************************************
* Add a tile layer to the map
*
* The url parameter must either point to the style as
* demonstrated below or to the URL of a Vector Tile service
* such as:
*
* https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap/VectorTileServer
*********************************************************************/
var tileLyr = new VectorTileLayer({
url: "http://g11n-test.mapsqa.arcgis.com/home/item.html?id=0ac2739a70b64ec0b6681918b78dcabd/root.json"
//url: "http://exchange.maps.arcgis.com/home/item.html?id=00388f35f14242ec9359af7a44d99b3d/p12/root.json"
});
map.add(tileLyr);
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>