Skip to content

Commit b1554d7

Browse files
committed
add examples of using vector tile layers as operational layers.
requires at least v3.15 or v4.0 beta 2 of the ESRI JS API
1 parent 5a59ec2 commit b1554d7

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

viewer/js/config/viewer.js

+57
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,63 @@ define([
158158
metadataUrl: true,
159159
expanded: true
160160
}
161+
/*
162+
//examples of vector tile layers (beta in v3.15)
163+
}, {
164+
type: 'vectortile',
165+
title: 'Light Gray Canvas Vector',
166+
url: '//www.arcgis.com/sharing/rest/content/items/bdf1eec3fa79456c8c7c2bb62f86dade/resources/styles/root.json',
167+
options: {
168+
id: 'vectortile1',
169+
opacity: 0.8,
170+
visible: true
171+
}
172+
}, {
173+
// taken from this demo: https://github.com/ycabon/presentations/blob/gh-pages/2015-berlin-plenary/demos/3.15-vectortile/create-by-style-object.html
174+
type: 'vectortile',
175+
title: 'Custom Vector Style',
176+
options: {
177+
id: 'vectortile2',
178+
opacity: 1.0,
179+
visible: true,
180+
'glyphs': '//www.arcgis.com/sharing/rest/content/items/00cd8e843bae49b3a040423e5d65416b/resources/fonts/{fontstack}/{range}.pbf',
181+
'sprite': '//www.arcgis.com/sharing/rest/content/items/00cd8e843bae49b3a040423e5d65416b/resources/sprites/sprite',
182+
'version': 8,
183+
'sources': {
184+
'esri': {
185+
'url': '//basemapsdev.arcgis.com/arcgis/rest/services/World_Basemap/VectorTileServer',
186+
'type': 'vector'
187+
}
188+
},
189+
'layers': [{
190+
'id': 'background',
191+
'type': 'background',
192+
'paint': {
193+
'background-color': '#556688'
194+
}
195+
}, {
196+
'id': 'Land',
197+
'type': 'fill',
198+
'source': 'esri',
199+
'source-layer': 'Land',
200+
'paint': {
201+
'fill-color': '#273344'
202+
},
203+
}, {
204+
'id': 'roads',
205+
'type': 'line',
206+
'source': 'esri',
207+
'source-layer': 'Road',
208+
'layout': {
209+
'line-join': 'round'
210+
},
211+
'paint': {
212+
'line-width': 1,
213+
'line-color': '#131622'
214+
}
215+
}]
216+
}
217+
*/
161218
}],
162219
// set include:true to load. For titlePane type set position the the desired order in the sidebar
163220
widgets: {

0 commit comments

Comments
 (0)