Skip to content
Open
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
30 changes: 11 additions & 19 deletions js/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ define([
this.config = defaults;
// Gets parameters from the URL, convert them to an object and remove HTML tags.
this.urlObject = this._createUrlParamsObject();
this.config.urlValues = this.urlObject;
},
startup: function () {
var promise = this._init();
Expand Down Expand Up @@ -131,7 +132,7 @@ define([
portal: this._createPortal(),
// get org data
org: this.queryOrganization()
}).then(lang.hitch(this, function () {
}).then(lang.hitch(this, function (appResults) {
// mixin all new settings from org and app
this._mixinAll();
// then execute these async
Expand Down Expand Up @@ -247,8 +248,7 @@ define([
},
_initializeApplication: function () {
// If this app is hosted on an Esri environment.
var overwrite = this.config.overwritesharing || false;
if (this.templateConfig.esriEnvironment && !overwrite) {
if (this.templateConfig.esriEnvironment) {
var appLocation,
instance;
// Check to see if the app is hosted or a portal. If the app is hosted or a portal set the
Expand All @@ -265,8 +265,6 @@ define([
this.config.sharinghost = location.protocol + "//" + location.host + instance;
this.config.proxyurl = location.protocol + "//" + location.host + instance + "/sharing/proxy";
}
} else {
this.config.sharinghost = location.protocol + "//" + this.config.sharinghost;
}
arcgisUtils.arcgisUrl = this.config.sharinghost + "/sharing/rest/content/items";
// Define the proxy url for the app
Expand Down Expand Up @@ -565,33 +563,27 @@ define([
cfg.units = "english";
}

// If it has the useVectorBasemaps property and its true then use the
// vectorBasemapGalleryGroupQuery otherwise use the default
var basemapGalleryGroupQuery = response.basemapGalleryGroupQuery;
if (response.hasOwnProperty("useVectorBasemaps") && response.useVectorBasemaps === true && response.vectorBasemapGalleryGroupQuery) {
basemapGalleryGroupQuery = response.vectorBasemapGalleryGroupQuery;
}

var q = this._parseQuery(basemapGalleryGroupQuery);
cfg.basemapgroup = {
//Get the basemap group for the organization
var q = this._parseQuery(response.basemapGalleryGroupQuery);
this.orgConfig.basemapgroup = {
id: null,
title: null,
owner: null
};
if (q.id) {
cfg.basemapgroup.id = q.id;
this.orgConfig.basemapgroup.id = q.id;
} else if (q.title && q.owner) {
cfg.basemapgroup.title = q.title;
cfg.basemapgroup.owner = q.owner;
this.orgConfig.basemapgroup.title = q.title;
this.orgConfig.basemapgroup.owner = q.owner;
}
// Get the helper services (routing, print, locator etc)
cfg.helperServices = response.helperServices;
// are any custom roles defined in the organization?
/*if (response.user && esriLang.isDefined(response.user.roleId)) {
if (response.user && esriLang.isDefined(response.user.roleId)) {
if (response.user.privileges) {
cfg.userPrivileges = response.user.privileges;
}
}*/
}
this.orgConfig = cfg;
deferred.resolve(cfg);
}), function (error) {
Expand Down