Skip to content

Commit

Permalink
Add VectorTileLayer as a new type of operational layer.
Browse files Browse the repository at this point in the history
requires at least v3.15 or v4.0 beta 2 of the ESRI JS API
  • Loading branch information
tmcgee committed Nov 23, 2015
1 parent a176c14 commit 65bd746
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions viewer/js/gis/dijit/LayerControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ define([
georss: './LayerControl/controls/GeoRSS',
wms: './LayerControl/controls/WMS',
kml: './LayerControl/controls/KML',
vectortile: './LayerControl/controls/VectorTile',
webtiled: './LayerControl/controls/WebTiled',
imagevector: './LayerControl/controls/ImageVector',
raster: './LayerControl/controls/Raster',
Expand Down
24 changes: 24 additions & 0 deletions viewer/js/gis/dijit/LayerControl/controls/VectorTile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_Contained',
'./_Control' // layer control base class
], function (
declare,
_WidgetBase,
_TemplatedMixin,
_Contained,
_Control
) {
'use strict';

var VectorTileControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
_esriLayerType: 'vectortile', // constant
_layerTypeInit: function () {
this._expandRemove();
}
});
return VectorTileControl;
});
8 changes: 7 additions & 1 deletion viewer/js/viewer/_MapMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ define([
raster: 'Raster',
stream: 'Stream',
tiled: 'ArcGISTiledMapService',
vectortile: 'VectorTile',
webtiled: 'WebTiled',
wms: 'WMS',
wmts: 'WMTS' //untested
Expand Down Expand Up @@ -97,7 +98,12 @@ define([
},

_initLayer: function (layer, Layer) {
var l = new Layer(layer.url, layer.options);
var l;
if (layer.url) {
l = new Layer(layer.url, layer.options);
} else {
l = new Layer(layer.options);
}
this.layers.unshift(l); //unshift instead of push to keep layer ordering on map intact

//Legend LayerInfos array
Expand Down

0 comments on commit 65bd746

Please sign in to comment.