Skip to content

Commit

Permalink
support updating Vector Tile Styles
Browse files Browse the repository at this point in the history
Fixes Esri#157.
  • Loading branch information
ecaldwell committed Nov 29, 2016
1 parent 6fd4ccd commit 11212b5
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,13 @@ require([
.then(function(data) {
webmapData = JSON.stringify(data);
var operationalLayers = [];
jquery.each(data.operationalLayers, function(layer) {
if (data.operationalLayers[layer].hasOwnProperty("url")) {
operationalLayers.push(data.operationalLayers[layer]);
jquery.each(data.operationalLayers, function() {
if (this.hasOwnProperty("url")) {
operationalLayers.push(this);
} else if (this.hasOwnProperty("styleUrl")) {
// Support updating Vector Tile Styles.
this.url = this.styleUrl;
operationalLayers.push(this);
}
});

Expand All @@ -615,9 +619,13 @@ require([

var basemapTitle = data.baseMap.title;
var basemapLayers = [];
jquery.each(data.baseMap.baseMapLayers, function(layer) {
if (data.baseMap.baseMapLayers[layer].hasOwnProperty("url")) {
basemapLayers.push(data.baseMap.baseMapLayers[layer]);
jquery.each(data.baseMap.baseMapLayers, function() {
if (this.hasOwnProperty("url")) {
basemapLayers.push(this);
} else if (this.hasOwnProperty("styleUrl")) {
// Support updating Vector Tile Styles.
this.url = this.styleUrl;
basemapLayers.push(this);
}
});

Expand Down

0 comments on commit 11212b5

Please sign in to comment.