Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support updating Vector Tile Styles and Services #159

Merged
merged 2 commits into from
Dec 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 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 Expand Up @@ -752,7 +760,7 @@ require([
var updateContentUrls = function() {
var owner;
var folder;
var supportedContent = jquery(".content[data-type='Feature Service'], .content[data-type='Map Service'], .content[data-type='Image Service'], .content[data-type='KML'], .content[data-type='WMS'], .content[data-type='Geodata Service'], .content[data-type='Globe Service'], .content[data-type='Geometry Service'], .content[data-type='Geocoding Service'], .content[data-type='Network Analysis Service'], .content[data-type='Geoprocessing Service'], .content[data-type='Web Mapping Application'], .content[data-type='Mobile Application'], .content[data-type='Scene Service']");
var supportedContent = jquery(".content[data-type='Feature Service'], .content[data-type='Map Service'], .content[data-type='Image Service'], .content[data-type='KML'], .content[data-type='WMS'], .content[data-type='Geodata Service'], .content[data-type='Globe Service'], .content[data-type='Geometry Service'], .content[data-type='Geocoding Service'], .content[data-type='Network Analysis Service'], .content[data-type='Geoprocessing Service'], .content[data-type='Web Mapping Application'], .content[data-type='Mobile Application'], .content[data-type='Scene Service'], .content[data-type='Vector Tile Service']");
var portal = app.portals.sourcePortal;

// Highlight supported content.
Expand Down