From df0530e67665996a01f284a8005e2fcde2dab310 Mon Sep 17 00:00:00 2001 From: Kelly Hutchins Date: Tue, 27 Jun 2017 11:38:49 -0700 Subject: [PATCH] update to 3.21 --- config/defaults.js | 2 +- images/config-images/default.png | Bin 5129 -> 0 bytes images/config-images/full.png | Bin 4656 -> 0 bytes index.html | 31 ++--- js/main.js | 164 ++++++++++++----------- js/template.js | 118 +++++++++-------- resources/configurationPanel.js | 218 ++++++++++++++++--------------- 7 files changed, 270 insertions(+), 263 deletions(-) delete mode 100644 images/config-images/default.png delete mode 100644 images/config-images/full.png diff --git a/config/defaults.js b/config/defaults.js index 0e24448..c8b8f1f 100755 --- a/config/defaults.js +++ b/config/defaults.js @@ -117,4 +117,4 @@ define({ "customstyle": null, "customLayout": "default" // default, fullprofile -}); +}); \ No newline at end of file diff --git a/images/config-images/default.png b/images/config-images/default.png deleted file mode 100644 index 0f3d974999d2b06cd225481bcdf9544da2330e95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5129 zcmV+k6!zPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^Ag1Z(U7026shL_t(|UhSP}R1{a*#~*eOjcZ)v5*J(& zaZfa^ao_hPYBZTlCZ6Oy<2y-a;>>(<&YU-AOw1%EZgIt+5hLy>ASxi@E`o|62&jm- zgDA?{_1^!}x3Pe3x~jV{e&BabN!P9F>Z*F~z0X>u%i6UYl>Gdsq$mpg-gtX^QAtUO zSW0D!eOz5##NtXWE-t)|>nJTP6@PiPO7Im=Pfz}SK|z70?`Q?b_V)HBlgUJdg+;Q} zHaLG@-&#aJ{IFaRH$hy-?@v(Bb|pRinq1RHadC-q?b>za>eVzQHT9~Jm32#Q(MD|S z31#EPU*wvxY~Q|92@MUGYgGdoKo+jzGxv~}f#%JdQ&!eZxn`S3j~>z4v*#!vAdr6j zHHc1}I7O#VpXIj5$Y>Hbm?9z$)3ay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e-qPVkvRVnQ~6R+Tjf=#j6sAO#SoabINFPs09Z@5SWug9 zpjE3@{5LH%m5Rhkc*;y$sW^l7VRmx$viaxsZE zMKxdJSbRLO&9dNjmI}d`N{Z-W;$`aGxidv=-%KfK>HK@@YsER1TT1a8CQj;EKt(0W zNh`j-X~l|FG-Sv?PJ0|be#-F?Vy)-6iQcSU+{Hyddsaw=ikODnJt+54URm$5EC2%a z6c>pbkHu5?M4n>!q791?pv&M$ya<6{sfw~|aQCFzVoJif7Wp<14d(QM`Z_Bu*k0iY zfxrL#Z&XlFM5|V7urAlkqG06#y1 zH!01SF_pJl1mcjVUW0zro_cO>E6DwOPbL!L?W#!5>a!nh7fm@U_XX50Vb3{ZOQTFT!k!zK~ zJ%ucUKP8+p;miQhUge_3T05TMz~c;!8ky^})cdFxv4!w@K)gBw5B^uRue}AJ{ur+s zOixee_dw#kC&02Dh2$u)!Lx&);xQ^N0MB)Zdqll^o9lC}?Wbh{C{@L?>Ub~*Slb6O zV8w3Kf9N8P#hxjSgSk-4;qa&c_BG-iDkz|{{60buxS19(PovHY?ONYPftVT!=J1Gx rv-bw)hGIOt=s-&*wlyqxEvqET4^00000NkvXXu0mjf?bz84 diff --git a/images/config-images/full.png b/images/config-images/full.png deleted file mode 100644 index edc6e2e81553eee463c3f97ff99db9d242a10b8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4656 zcmV-063^|4P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^Ag1Z(U701==`L_t(|UhSNDP!!j`$A4@B?n~l=F&aTc z6H!nTjoXcail}HbF={kZyMaf?z>@qiRXp(l-- zn=3tf^ho^F$`RW*Iy#6SM{;m*;B8z-ZEdai&6`bvkF;yojz3>nS!vg2>;=bmb91A* zx;m<=s+ObH!TERS(4OeaFTYj9O%T`d())~W#Gn*n{?__x;R!Y@AK-bV;W65sKqT? zLTU8q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UZjFyTox}jbW!;G`*BGZx)B%KRI3nF zM6X`G#J-p1h<>1X3@)xUFAysfF$0?Nkjh4vi6wA7@4x>Z-zc=SmX?k!XaQX$tf(KC72N zE?vrHb*ZMcAL$MlW*AzeFI-%l`Mh#-^H?39KAp}f7ZjXehY*;-yF|1PC&1od5MCv& zADIM8AmzSv>7qt0K21?CkeM@QuWsMIgD`62C^~vSpDg;4%)!M%;#E~OV#)6mU-sA& z!@+Q|zP`R3v^5vBCZVW^MDQ-dF4DZugx*x$Mo)7W#v@hdfijavxWlf(xV>Mht)8*H-YZt!Zh(NIf zvFy!L6#zLIxV%VdAWMprb91^<(C?a@oJ{lQ&l5MvmB;Yietw2?K?M%!Y)cP%>H%U2 zPuE-@VjI$iK8}jo z%WXN9nyQhEgNFjcxNlz!``yr?T0mo7NJt3ldsB?(f?2zBXSj&KEBMB>1c+NOK~Wvu zzdwfEW4NzXRh41|m06AE@fZWL&*%x$f>9v#afmhG)_wHR3f|}Q&%b1^#S)Vzzb5?r zWh@kAJ=GSm!ozp7N*Xw@VZ>_+y6so4{DdApe83$WYC87S0uKt^@Tj@q4;mmVfTx_$ zcWe$a8n%sv_;qtg+8;&toSUv`J3G5jJH__X zTj$eG@Of&%+UHKjM^igjS8~;m_BTByo(gky6ZcH~Bpr;WcSlH zXM{xHSo`Ra95J9}1|>xACB;#ePF-B6&g_^tx%wcr+VF^5kB;s%dUC_2wuF6A^a#fh zKE1V|))-sypFtA)VC9)ksKCI+k9^0+$3H$^t>N69>K;+GgR{l!#eH+FF+56M - - @@ -14,8 +12,8 @@ - - + + @@ -98,7 +96,7 @@

dojoConfig.locale = RegExp.$1; } - + - \ No newline at end of file + diff --git a/js/main.js b/js/main.js index eba7890..0a7a0a0 100755 --- a/js/main.js +++ b/js/main.js @@ -46,7 +46,7 @@ define([ "application/ElevationProfileSetup", "dojo/domReady!" -], function( +], function ( declare, array, lang, kernel, Color, on, mouse, query, Deferred, @@ -63,7 +63,7 @@ define([ return declare(null, { config: {}, containers: [], - startup: function(config) { + startup: function (config) { // Set lang attribute to current locale document.documentElement.lang = kernel.locale; var promise; @@ -107,9 +107,9 @@ define([ geometryService: this.config.helperServices.geometry.url }); - mapParams.processUrlParams().then(lang.hitch(this, function(urlParams) { + mapParams.processUrlParams().then(lang.hitch(this, function (urlParams) { promise = this._createWebMap(itemInfo, urlParams); - }), lang.hitch(this, function(error) { + }), lang.hitch(this, function (error) { this.reportError(error); })); @@ -124,7 +124,7 @@ define([ } return promise; }, - reportError: function(error) { + reportError: function (error) { // remove loading class from body domClass.remove(document.body, "app-loading"); domClass.add(document.body, "app-error"); @@ -145,7 +145,7 @@ define([ }, // create a map based on the input web map id - _createWebMap: function(itemInfo, params) { + _createWebMap: function (itemInfo, params) { // set extent from config/url //enable/disable the slider @@ -159,7 +159,7 @@ define([ layerMixins: this.config.layerMixins || [], editable: this.config.editable, bingMapsKey: this.config.orgInfo.bingKey || "" - }).then(lang.hitch(this, function(response) { + }).then(lang.hitch(this, function (response) { this.map = response.map; dom.byId("elevTitle").innerHTML = this.config.title || response.itemInfo.item.title; document.title = this.config.title || response.itemInfo.item.title; @@ -174,14 +174,14 @@ define([ // remove loading class from body domClass.remove(document.body, "app-loading"); - on(window, "resize", function() { + on(window, "resize", function () { registry.byId("elevProfileChart").resize(); }); if (params.markerGraphic) { // Add a marker graphic with an optional info window if // one was specified via the marker url parameter - require(["esri/layers/GraphicsLayer"], lang.hitch(this, function(GraphicsLayer) { + require(["esri/layers/GraphicsLayer"], lang.hitch(this, function (GraphicsLayer) { var markerLayer = new GraphicsLayer(); this.map.addLayer(markerLayer); @@ -199,7 +199,7 @@ define([ // Hide or show profile when button is clicked. var profileToggle = dom.byId("toggleProfile"); profileToggle.title = this.config.i18n.elevation.toggle; - on(profileToggle, "click", lang.hitch(this, function() { + on(profileToggle, "click", lang.hitch(this, function () { this._togglePanel("panelContent"); })); this._setupAppTools(); @@ -211,7 +211,7 @@ define([ return response; }), this.reportError); }, - _drawLine: function(Draw) { + _drawLine: function (Draw) { // Add active class domClass.toggle("drawTool", "active"); if (domClass.contains("drawTool", "active")) { @@ -223,17 +223,17 @@ define([ this.drawTool.deactivate(); return; } - on(this.drawTool, "draw-complete", lang.hitch(this, function(result) { + on(this.drawTool, "draw-complete", lang.hitch(this, function (result) { this.elevationWidget.generateProfile(result.geometry); - on.once(this.map, "click", lang.hitch(this, function() { + on.once(this.map, "click", lang.hitch(this, function () { this.elevationWidget.clearProfileChart(); })); })); }, - _setupAppTools: function() { + _setupAppTools: function () { // setup the draw tool if (this.config.elevationDraw) { - require(["esri/toolbars/draw"], lang.hitch(this, function(Draw) { + require(["esri/toolbars/draw"], lang.hitch(this, function (Draw) { var drawToolButton = dom.byId("drawTool"); @@ -244,15 +244,15 @@ define([ if (this.map.infoWindow.lineSymbol) { this.drawTool.setLineSymbol(this.map.infoWindow.lineSymbol); } - on(drawToolButton, "click", lang.hitch(this, function() { + on(drawToolButton, "click", lang.hitch(this, function () { this._drawLine(Draw); })); })); } - query(".closeBtn").on("click", lang.hitch(this, function() { - array.forEach(this.containers, lang.hitch(this, function(container) { + query(".closeBtn").on("click", lang.hitch(this, function () { + array.forEach(this.containers, lang.hitch(this, function (container) { domClass.remove(container.btn, "activeTool"); domStyle.set(container.container, { visibility: "hidden" @@ -261,14 +261,15 @@ define([ })); })); // setup the basemap tool - if (this.config.basemaps) { - require(["esri/dijit/BasemapGallery"], lang.hitch(this, function(BasemapGallery) { + if (this.config.basemaps && !this.config.basemapToggle) { + require(["esri/dijit/BasemapGallery"], lang.hitch(this, function (BasemapGallery) { var basemapGallery = new BasemapGallery({ map: this.map, portalUrl: this.config.sharinghost, bingMapsKey: this.config.orgInfo.bingKey || "", - basemapsGroup: this._getBasmapGroup + basemapsGroup: this._getBasemapGroup() }, "basemapDiv"); + basemapGallery.startup(); var basemapButton = dom.byId("basemapBtn"); domStyle.set(basemapButton, "display", "inline-block"); @@ -277,13 +278,13 @@ define([ btn: "basemapBtn", container: "basemapContainer" }); - on(basemapButton, "click", lang.hitch(this, function() { + on(basemapButton, "click", lang.hitch(this, function () { this._toggleButtonContainer(basemapButton, "basemapContainer"); })); })); } if (this.config.basemapToggle) { - require(["esri/dijit/BasemapToggle", "esri/basemaps"], lang.hitch(this, function(BasemapToggle, basemaps) { + require(["esri/dijit/BasemapToggle", "esri/basemaps"], lang.hitch(this, function (BasemapToggle, basemaps) { /* Start temporary until after JSAPI 4.0 is released */ var bmLayers = [], @@ -298,7 +299,7 @@ define([ } } } - on.once(this.map, "basemap-change", lang.hitch(this, function() { + on.once(this.map, "basemap-change", lang.hitch(this, function () { if (bmLayers && bmLayers.length) { for (var i = 0; i < bmLayers.length; i++) { bmLayers[i].setVisibility(false); @@ -345,7 +346,7 @@ define([ } // setup the legend tool if (this.config.legend) { - require(["esri/dijit/LayerList"], lang.hitch(this, function(LayerList) { + require(["esri/dijit/LayerList"], lang.hitch(this, function (LayerList) { var legendButton = dom.byId("legendBtn"); domStyle.set(legendButton, "display", "inline-block"); legendButton.title = this.config.i18n.legend.tip; @@ -355,7 +356,7 @@ define([ }); var layerList = null; - on(legendButton, "click", lang.hitch(this, function() { + on(legendButton, "click", lang.hitch(this, function () { this._toggleButtonContainer(legendButton, "legendContainer"); if (!layerList) { @@ -379,7 +380,7 @@ define([ } // setup the share dialog if (this.config.share) { - require(["application/ShareDialog"], lang.hitch(this, function(ShareDialog) { + require(["application/ShareDialog"], lang.hitch(this, function (ShareDialog) { var shareButton = dom.byId("shareBtn"); domStyle.set(shareButton, "display", "inline-block"); @@ -397,15 +398,15 @@ define([ summary: this.config.response.itemInfo.item.snippet || "" }, "shareDiv"); shareDialog.startup(); - on(shareButton, "click", lang.hitch(this, function() { + on(shareButton, "click", lang.hitch(this, function () { this._toggleButtonContainer(shareButton, "shareContainer"); })); })); } //Feature Search or find (if no search widget) - if ( (this.config.find || (this.config.customUrlLayer.id !== null && this.config.customUrlLayer.fields.length > 0 && this.config.customUrlParam !== null)) ) { - require(["esri/dijit/Search", "esri/urlUtils", "esri/lang"], lang.hitch(this, function(Search, urlUtils, esriLang) { + if ((this.config.find || (this.config.customUrlLayer.id !== null && this.config.customUrlLayer.fields.length > 0 && this.config.customUrlParam !== null))) { + require(["esri/dijit/Search", "esri/urlUtils", "esri/lang"], lang.hitch(this, function (Search, urlUtils, esriLang) { //Support find or custom url param if (this.config.find) { @@ -448,9 +449,9 @@ define([ if (source) { urlSearch.set("sources", [source]); } - urlSearch.on("load", lang.hitch(this, function() { - urlSearch.search(value).then(lang.hitch(this, function() { - on.once(this.map.infoWindow, "hide", lang.hitch(this, function() { + urlSearch.on("load", lang.hitch(this, function () { + urlSearch.search(value).then(lang.hitch(this, function () { + on.once(this.map.infoWindow, "hide", lang.hitch(this, function () { urlSearch.clear(); urlSearch.destroy(); if (this.editor) { @@ -467,7 +468,7 @@ define([ if (this.config.search) { - require(["esri/dijit/Search", "esri/tasks/locator", "application/SearchSources"], lang.hitch(this, function(Search, Locator, SearchSources) { + require(["esri/dijit/Search", "esri/tasks/locator", "application/SearchSources"], lang.hitch(this, function (Search, Locator, SearchSources) { if (!Search || !Locator) { return; } @@ -507,7 +508,7 @@ define([ domClass.add(document.body, "nosearch"); } }, - _getBasemapGroup: function() { + _getBasemapGroup: function () { //Get the id or owner and title for an organizations custom basemap group. var basemapGroup = null; if (this.config.basemapgroup && this.config.basemapgroup.title && this.config.basemapgroup.owner) { @@ -522,7 +523,7 @@ define([ } return basemapGroup; }, - _toggleButtonContainer: function(button, container) { + _toggleButtonContainer: function (button, container) { var position = domGeometry.position(button); domClass.toggle(button, "activeTool"); if (domClass.contains(button, "activeTool")) { @@ -543,7 +544,7 @@ define([ } // close any other open tool containers - array.forEach(this.containers, lang.hitch(this, function(container) { + array.forEach(this.containers, lang.hitch(this, function (container) { if (container.btn !== button.id && domClass.contains(dom.byId(container.btn), "activeTool")) { domClass.toggle(container.btn, "activeTool"); domStyle.set(container.container, { @@ -554,7 +555,7 @@ define([ })); }, - _setupProfile: function() { + _setupProfile: function () { // Set the panel location domClass.add(dom.byId("panelContainer"), this.config.panelLocation); domClass.add(document.body, this.config.panelLocation); @@ -604,30 +605,30 @@ define([ this.elevationWidget = new ElevationProfileSetup(params); this.elevationWidget.setupProfile(); if (this.elevationWidget.profileWidget && this.elevationWidget.profileWidget._directionButton) { - on(this.elevationWidget.profileWidget._directionButton, "click", lang.hitch(this, function() { - on.once(this.elevationWidget.profileWidget._profileChart, "chart-update", lang.hitch(this, function() { + on(this.elevationWidget.profileWidget._directionButton, "click", lang.hitch(this, function () { + on.once(this.elevationWidget.profileWidget._profileChart, "chart-update", lang.hitch(this, function () { var content = esriLang.substitute(this.elevationWidget.generateElevationInfo(), this.config.i18n.elevation.gainLossTemplate); dom.byId("elevInfo").innerHTML = content; })); })); } - on(this.elevationWidget, "profile-generated", lang.hitch(this, function() { + on(this.elevationWidget, "profile-generated", lang.hitch(this, function () { //open profile chart if closed var height = domStyle.get(dom.byId("panelContent"), "height"); if (height <= 0) { this._togglePanel("panelContent"); } - on.once(this.elevationWidget.profileWidget._profileChart, "chart-clear", function() { + on.once(this.elevationWidget.profileWidget._profileChart, "chart-clear", function () { dom.byId("elevInfo").innerHTML = ""; }); - on.once(this.elevationWidget.profileWidget._profileChart, "chart-update", lang.hitch(this, function() { + on.once(this.elevationWidget.profileWidget._profileChart, "chart-update", lang.hitch(this, function () { var content = esriLang.substitute(this.elevationWidget.generateElevationInfo(), this.config.i18n.elevation.gainLossTemplate); dom.byId("elevInfo").innerHTML = content; })); })); }, - _updateTheme: function() { + _updateTheme: function () { var bgColor = this.config.background; var bgOpacity = Number(this.config.backgroundOpacity); var textColor = this.config.color; @@ -671,7 +672,7 @@ define([ }, - _togglePanel: function(chartNode) { + _togglePanel: function (chartNode) { var element = dom.byId(chartNode), height = domStyle.get(element, "height"), opacity = parseInt(domStyle.get(element, "opacity")), @@ -685,20 +686,20 @@ define([ properties: { height: height === 0 ? 210 : 0 }, - onBegin: function() { + onBegin: function () { // hide the panel if showing when animation starts if (opacity === 1) { domStyle.set(element, "opacity", "0"); } }, - onEnd: function() { + onEnd: function () { // when height animation ends show/hide panel domStyle.set(element, "opacity", opacity === 0 ? 1 : 0); domStyle.set(element, "visibility", visibility === "hidden" ? "visible" : "hidden"); } }).play(); }, - _setupSplashModal: function() { + _setupSplashModal: function () { // Setup the modal overlay if enabled if (this.config.splashModal) { domClass.remove("modal", "hide"); @@ -709,47 +710,44 @@ define([ dom.byId("closeOverlay").value = this.config.splashButtonText || this.config.i18n.nav.close; // Close button handler for the overlay - on(dom.byId("closeOverlay"), "click", lang.hitch(this, function() { + on(dom.byId("closeOverlay"), "click", lang.hitch(this, function () { domClass.add("modal", "hide"); })); } }, - _getBasemapName: function(name) { - var current = null; - switch (name) { - case "dark-gray": - current = "Dark Gray Canvas"; - break; - case "gray": - current = "Light Gray Canvas"; - break; - case "hybrid": - current = "Imagery with Labels"; - break; - case "national-geographic": - current = "National Geographic"; - break; - case "oceans": - current = "Oceans"; - break; - case "osm": - current = "OpenStreetMap"; - break; - case "satellite": - current = "Imagery"; - break; - case "streets": - current = "Streets"; - break; - case "terrain": - current = "Terrain with Labels"; - break; - case "topo": - current = "Topographic"; - break; + _getBasemapName: function (name) { + // We have to do this because of localized strings we need + // a better solution + var current = "Streets"; + if (name === "dark-gray" || name === "dark-gray-vector") { + current = "Dark Gray Canvas"; + } else if (name === "gray" || name === "gray-vector") { + current = "Light Gray Canvas"; + } else if (name === "hybrid") { + current = "Imagery with Labels"; + } else if (name === "national-geographic") { + current = "National Geographic"; + } else if (name === "oceans") { + current = "Oceans"; + } else if (name === "osm") { + current = "OpenStreetMap"; + } else if (name === "satellite") { + current = "Imagery"; + } else if (name === "streets" || name === "streets-vector") { + current = "Streets"; + } else if (name === "streets-navigation-vector") { + current = "World Navigation Map"; + } else if (name === "streets-night-vector") { + current = "World Street Map (Night)"; + } else if (name === "streets-relief-vector") { + current = "World Street Map (with Relief)"; + } else if (name === "terrain") { + current = "Terrain with Labels"; + } else if (name === "topo" || name === "topo-vector") { + current = "Topographic"; } return current; } }); -}); +}); \ No newline at end of file diff --git a/js/template.js b/js/template.js index 13bf035..074558e 100755 --- a/js/template.js +++ b/js/template.js @@ -47,7 +47,7 @@ define([ "esri/tasks/GeometryService", "config/defaults" -], function( +], function ( array, declare, kernel, lang, Evented, Deferred, string, domClass, @@ -69,7 +69,7 @@ define([ customUrlConfig: {}, sharedThemeConfig: {}, commonUrlItems: ["webmap", "appid", "group", "oauthappid"], - constructor: function(templateConfig) { + constructor: function (templateConfig) { // template settings var defaultTemplateConfig = { queryForWebmap: true @@ -80,12 +80,12 @@ define([ // Gets parameters from the URL, convert them to an object and remove HTML tags. this.urlObject = this._createUrlParamsObject(); }, - startup: function() { + startup: function () { var promise = this._init(); - promise.then(lang.hitch(this, function(config) { + promise.then(lang.hitch(this, function (config) { // optional ready event to listen to this.emit("ready", config); - }), lang.hitch(this, function(error) { + }), lang.hitch(this, function (error) { // optional error event to listen to this.emit("error", error); })); @@ -93,7 +93,7 @@ define([ }, // Get URL parameters and set application defaults needed to query arcgis.com for // an application and to see if the app is running in Portal or an Org - _init: function() { + _init: function () { var deferred; deferred = new Deferred(); // Set the web map, group and appid if they exist but ignore other url params. @@ -120,7 +120,7 @@ define([ // default value is arcgis.com. this._initializeApplication(); // check if signed in. Once we know if we're signed in, we can get appConfig, orgConfig and create a portal if needed. - this._checkSignIn().always(lang.hitch(this, function() { + this._checkSignIn().always(lang.hitch(this, function () { // execute these tasks async all({ // get localization @@ -131,7 +131,7 @@ define([ portal: this._createPortal(), // get org data org: this.queryOrganization() - }).then(lang.hitch(this, function() { + }).then(lang.hitch(this, function () { // mixin all new settings from org and app this._mixinAll(); // then execute these async @@ -144,7 +144,7 @@ define([ groupItems: this.queryGroupItems(), // shared themes sharedTheme: this.querySharedTheme() - }).then(lang.hitch(this, function() { + }).then(lang.hitch(this, function () { // mixin all new settings from item, group info and group items. this._mixinAll(); // We have all we need, let's set up a few things @@ -156,7 +156,7 @@ define([ // return promise return deferred.promise; }, - _completeApplication: function() { + _completeApplication: function () { // ArcGIS.com allows you to set an application extent on the application item. Overwrite the // existing web map extent with the application item extent when set. if (this.config.appid && this.config.application_extent && this.config.application_extent.length > 0 && this.config.itemInfo && this.config.itemInfo.item && this.config.itemInfo.item.extent) { @@ -174,18 +174,18 @@ define([ esriConfig.defaults.geometryService = new GeometryService(this.config.helperServices.geometry.url); } }, - _mixinAll: function() { + _mixinAll: function () { /* mix in all the settings we got! {} <- i18n <- organization <- application <- group info <- group items <- webmap <- custom url params <- standard url params. */ lang.mixin(this.config, this.i18nConfig, this.orgConfig, this.appConfig, this.groupInfoConfig, this.groupItemConfig, this.itemConfig, this.customUrlConfig, this.urlConfig); }, - _createPortal: function() { + _createPortal: function () { var deferred = new Deferred(); if (this.templateConfig.queryForGroupInfo || this.templateConfig.queryForGroupItems) { this.portal = new esriPortal.Portal(this.config.sharinghost); - this.portal.on("load", function() { + this.portal.on("load", function () { deferred.resolve(); }); } else { @@ -193,7 +193,7 @@ define([ } return deferred.promise; }, - _getUrlParamValues: function(items) { + _getUrlParamValues: function (items) { // retrieves only the items specified from the URL object. var urlObject = this.urlObject; var obj = {}; @@ -220,7 +220,7 @@ define([ } return obj; }, - _createUrlParamsObject: function() { + _createUrlParamsObject: function () { var urlObject, url; // retrieve url parameters. Templates all use url parameters to determine which arcgis.com @@ -238,7 +238,7 @@ define([ urlObject.query = esriLang.stripTags(urlObject.query); return urlObject; }, - _initializeApplication: function() { + _initializeApplication: function () { // If this app is hosted on an Esri environment. if (this.templateConfig.esriEnvironment) { var appLocation, @@ -265,7 +265,7 @@ define([ esriConfig.defaults.io.alwaysUseProxy = false; } }, - _checkSignIn: function() { + _checkSignIn: function () { var deferred, signedIn, oAuthInfo; @@ -282,19 +282,19 @@ define([ // check sign-in status signedIn = IdentityManager.checkSignInStatus(this.config.sharinghost + "/sharing"); // resolve regardless of signed in or not. - signedIn.promise.always(function() { + signedIn.promise.always(function () { deferred.resolve(); }); return deferred.promise; }, - _queryLocalization: function() { + _queryLocalization: function () { var deferred, dirNode, classes, rtlClasses; deferred = new Deferred(); if (this.templateConfig.queryForLocale) { - require(["dojo/i18n!application/nls/resources"], lang.hitch(this, function(appBundle) { + require(["dojo/i18n!application/nls/resources"], lang.hitch(this, function (appBundle) { var cfg = {}; // Get the localization strings for the template and store in an i18n variable. Also determine if the // application is in a right-to-left language like Arabic or Hebrew. @@ -302,7 +302,7 @@ define([ // Bi-directional language support added to support right-to-left languages like Arabic and Hebrew // Note: The map must stay ltr cfg.i18n.direction = "ltr"; - array.some(["ar", "he"], lang.hitch(this, function(l) { + array.some(["ar", "he"], lang.hitch(this, function (l) { if (kernel.locale.indexOf(l) !== -1) { cfg.i18n.direction = "rtl"; return true; @@ -330,7 +330,7 @@ define([ } return deferred.promise; }, - queryGroupItems: function(options) { + queryGroupItems: function (options) { var deferred = new Deferred(), error, defaultParams, @@ -356,12 +356,12 @@ define([ }); } // get items from the group - this.portal.queryItems(params).then(lang.hitch(this, function(response) { + this.portal.queryItems(params).then(lang.hitch(this, function (response) { var cfg = {}; cfg.groupItems = response; this.groupItemConfig = cfg; deferred.resolve(cfg); - }), function(error) { + }), function (error) { deferred.reject(error); }); } else { @@ -374,7 +374,7 @@ define([ } return deferred.promise; }, - queryGroupInfo: function() { + queryGroupInfo: function () { var deferred = new Deferred(), error, params; @@ -386,12 +386,12 @@ define([ q: "id:\"" + this.config.group + "\"", f: "json" }; - this.portal.queryGroups(params).then(lang.hitch(this, function(response) { + this.portal.queryGroups(params).then(lang.hitch(this, function (response) { var cfg = {}; cfg.groupInfo = response; this.groupInfoConfig = cfg; deferred.resolve(cfg); - }), function(error) { + }), function (error) { deferred.reject(error); }); } else { @@ -404,7 +404,7 @@ define([ } return deferred.promise; }, - queryItem: function() { + queryItem: function () { var deferred, cfg = {}; // Get details about the specified web map. If the web map is not shared publicly users will @@ -415,7 +415,7 @@ define([ // Use local webmap instead of portal webmap if (this.templateConfig.useLocalWebmap) { // get webmap js file - require([this.templateConfig.localWebmapFile], lang.hitch(this, function(webmap) { + require([this.templateConfig.localWebmapFile], lang.hitch(this, function (webmap) { // return webmap json cfg.itemInfo = webmap; this.itemConfig = cfg; @@ -443,12 +443,12 @@ define([ } // use webmap from id else { - arcgisUtils.getItem(this.config.webmap).then(lang.hitch(this, function(itemInfo) { + arcgisUtils.getItem(this.config.webmap).then(lang.hitch(this, function (itemInfo) { // Set the itemInfo config option. This can be used when calling createMap instead of the webmap id cfg.itemInfo = itemInfo; this.itemConfig = cfg; deferred.resolve(cfg); - }), function(error) { + }), function (error) { if (!error) { error = new Error("Error retrieving display item."); } @@ -461,13 +461,13 @@ define([ } return deferred.promise; }, - queryApplication: function() { + queryApplication: function () { // Get the application configuration details using the application id. When the response contains // itemData.values then we know the app contains configuration information. We'll use these values // to overwrite the application defaults. var deferred = new Deferred(); if (this.config.appid) { - arcgisUtils.getItem(this.config.appid).then(lang.hitch(this, function(response) { + arcgisUtils.getItem(this.config.appid).then(lang.hitch(this, function (response) { var cfg = {}; if (response.item && response.itemData && response.itemData.values) { // get app config values - we'll merge them with config later. @@ -481,7 +481,7 @@ define([ } // get any app proxies defined on the application item if (response.item && response.item.appProxies) { - var layerMixins = array.map(response.item.appProxies, function(p) { + var layerMixins = array.map(response.item.appProxies, function (p) { return { "url": p.sourceUrl, "mixin": { @@ -493,7 +493,7 @@ define([ } this.appConfig = cfg; deferred.resolve(cfg); - }), function(error) { + }), function (error) { if (!error) { error = new Error("Error retrieving application configuration."); } @@ -504,7 +504,7 @@ define([ } return deferred.promise; }, - queryOrganization: function() { + queryOrganization: function () { var deferred = new Deferred(); if (this.templateConfig.queryForOrg) { // Query the ArcGIS.com organization. This is defined by the sharinghost that is specified. For example if you @@ -518,7 +518,7 @@ define([ "f": "json" }, callbackParamName: "callback" - }).then(lang.hitch(this, function(response) { + }).then(lang.hitch(this, function (response) { // Iterate over the list of authorizedCrossOriginDomains // and add each as a javascript obj to the corsEnabledServers var trustedHost; @@ -546,18 +546,24 @@ define([ // use feet/miles only for the US and if nothing is set for a user cfg.units = "english"; } - //Get the basemap group for the organization - var q = this._parseQuery(response.basemapGalleryGroupQuery); - this.orgConfig.basemapgroup = { + // 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 = { id: null, title: null, owner: null }; if (q.id) { - this.orgConfig.basemapgroup.id = q.id; + cfg.basemapgroup.id = q.id; } else if (q.title && q.owner) { - this.orgConfig.basemapgroup.title = q.title; - this.orgConfig.basemapgroup.owner = q.owner; + cfg.basemapgroup.title = q.title; + cfg.basemapgroup.owner = q.owner; } // Get the helper services (routing, print, locator etc) cfg.helperServices = response.helperServices; @@ -569,7 +575,7 @@ define([ } this.orgConfig = cfg; deferred.resolve(cfg); - }), function(error) { + }), function (error) { if (!error) { error = new Error("Error retrieving organization information."); } @@ -580,7 +586,7 @@ define([ } return deferred.promise; }, - _parseQuery: function(queryString) { + _parseQuery: function (queryString) { var regex = /(AND|OR)?\W*([a-z]+):/ig, fields = {}, @@ -597,25 +603,25 @@ define([ } return fields; }, - querySharedTheme: function() { + querySharedTheme: function () { var deferred = new Deferred(); if (this.config && this.config.sharedTheme) { esriConfig.defaults.io.corsEnabledServers.push("opendata.arcgis.com"); var sharedThemeStatus = this._getSharedThemeStatus(this.config.sharedTheme); - this._getSharedThemeObject(sharedThemeStatus).then(function(response) { + this._getSharedThemeObject(sharedThemeStatus).then(function (response) { deferred.resolve(response); - }, function() { + }, function () { var error = new Error("Unable to get theme"); deferred.reject(error); }); } else if (this.config && this.config.sharedThemeItem) { - arcgisUtils.getItem(this.config.sharedThemeItem).then(lang.hitch(this, function(response) { + arcgisUtils.getItem(this.config.sharedThemeItem).then(lang.hitch(this, function (response) { if (response && response.itemData && response.itemData.data) { this.config.sharedThemeConfig = response.itemData.data; } deferred.resolve(); - }), function(error) { + }), function (error) { deferred.reject(error); }); @@ -625,7 +631,7 @@ define([ } return deferred.promise; }, - _getSharedThemeStatus: function(input) { + _getSharedThemeStatus: function (input) { // we have a theme url param get theming var result = {}; if (/\d+/.test(input)) { // numeric theme value @@ -637,7 +643,7 @@ define([ } // leaving out appid for now return result; }, - _getSharedThemeObject: function(sharedThemeStatus) { + _getSharedThemeObject: function (sharedThemeStatus) { var deferred = new Deferred(); var requestUrl = this._generateRequestUrl(sharedThemeStatus); // if the status is site id or domain lookup make an external API call to opendatadev.arcgis.com @@ -646,7 +652,7 @@ define([ url: requestUrl, handleAs: "json" }); - themeRequest.then(lang.hitch(this, function(response) { + themeRequest.then(lang.hitch(this, function (response) { // return for a domain call is an array so adjust the call slightly if (sharedThemeStatus.status === "domain" && response && response.data && response.data.length && response.data.length > 0) { this.config.sharedThemeConfig = response.data[0]; @@ -654,7 +660,7 @@ define([ this.config.sharedThemeConfig = response.data; } deferred.resolve(); - }), function(error) { + }), function (error) { deferred.reject(error); }); } else { @@ -662,7 +668,7 @@ define([ } return deferred.promise; }, - _generateRequestUrl: function(status) { + _generateRequestUrl: function (status) { var requestUrl; switch (status.status) { // "https://opendata.arcgis.com/api/v2/sites/" + status.output; @@ -682,4 +688,4 @@ define([ } }); -}); +}); \ No newline at end of file diff --git a/resources/configurationPanel.js b/resources/configurationPanel.js index 46c9531..7d33bca 100755 --- a/resources/configurationPanel.js +++ b/resources/configurationPanel.js @@ -1,14 +1,11 @@ { "configurationSettings": [{ - "category": "Map", + "category": "General", "fields": [{ "type": "webmap" }, { "type": "appproxies" - }] - }, { - "category": "General", - "fields": [{ + }, { "placeHolder": "Defaults to web map title", "label": "Title:", "fieldName": "title", @@ -21,9 +18,6 @@ "type": "string", "tooltip": "Defaults to web map snippet", "stringFieldOption": "richtext" - }, { - "type": "subcategory", - "label": "Splash Screen" }, { "type": "conditional", "condition": false, @@ -51,17 +45,8 @@ }, { "category": "Theme", "fields": [{ - "type": "radio", - "fieldName": "customLayout", - "label": "Custom Layout", - "items": [{ - "label": "Default", - "value": "default", - "checked": true - }, { - "label": "Full Width Profile", - "value": "fullprofile" - }] + "type": "subcategory", + "label": "Colors" }, { "type": "paragraph", "value": "Define background and text colors for the app" @@ -82,6 +67,69 @@ "tooltip": "Choose a text color", "label": "Text color", "sharedThemeProperty": "header.text" + }, { + "type": "subcategory", + "label": "Profile Theme" + }, { + "type": "paragraph", + "value": "Specify custom colors for the elevation profile chart. Default color scheme is blue/gray" + }, { + "type": "color", + "fieldName": "axisFontColor", + "tooltip": "Choose text color for the axis", + "label": "Axis font color" + }, { + "type": "color", + "fieldName": "axisMajorTickColor", + "tooltip": "Choose tick color", + "label": "Axis major tick color" + }, { + "type": "color", + "fieldName": "elevationBottomColor", + "tooltip": "Specify bottom elevation color", + "label": "Elevation bottom color" + }, { + "type": "color", + "fieldName": "elevationTopColor", + "tooltip": "Specify top elevation color", + "label": "Elevation top color" + }, { + "type": "color", + "fieldName": "skyBottomColor", + "tooltip": "Specify sky bottom color", + "label": "Sky bottom color" + }, { + "type": "color", + "fieldName": "skyTopColor", + "tooltip": "Specify sky top color", + "label": "Sky top color" + }, { + "type": "subcategory", + "label": "Layout Options" + }, { + "type": "string", + "fieldName": "panelLocation", + "label": "Elevation profile location", + "tooltip": "Specify profile panel location", + "options": [{ + "label": "Bottom Center", + "value": "bottom-center" + }, { + "label": "Top Center", + "value": "top-center" + }] + }, { + "type": "radio", + "fieldName": "customLayout", + "label": "Custom Layout", + "items": [{ + "label": "Default", + "value": "default", + "checked": true + }, { + "label": "Full Width Profile", + "value": "fullprofile" + }] }, { "type": "paragraph", "value": "Use the Custom css option to paste css that overwrites rules in the app." @@ -110,22 +158,23 @@ "label": "Share Dialog", "tooltip": "Display share dialog" }, { - "type": "conditional", - "condition": false, + "type": "paragraph", + "value": "Basemap Switcher: Choose one. If both basemap gallery and basemap toggle are selected only the toggle will display." + }, { + "type": "boolean", "fieldName": "basemaps", "tooltip": "Enable basemap gallery", - "label": "Basemap Gallery", + "label": "Basemap Gallery" + }, { + "type": "conditional", + "condition": false, + "fieldName": "basemapToggle", + "label": "Basemap Toggle", "items": [{ - "type": "conditional", - "condition": false, - "fieldName": "basemapToggle", - "label": "Basemap Toggle", - "items":[{ "type": "basemaps", "fieldName": "alt_basemap", "tooltip": "Select the alternate basemap", - "label": "Alternate Basmap" - }] + "label": "Alternate Basemap" }] }] }, { @@ -143,63 +192,26 @@ "value": "english" }] }, { - "type": "string", - "fieldName": "panelLocation", - "label": "Elevation profile location", - "tooltip": "Specify profile panel location", - "options": [{ - "label": "Bottom Center", - "value": "bottom-center" - }, { - "label": "Top Center", - "value": "top-center" - }] + "type": "boolean", + "fieldName": "elevationDraw", + "label": "Display draw tool", + "tooltip": "Draw a line to generate an elevation profile" }, { "type": "paragraph", - "value": "This application uses the Elevation Analysis Profile Task to generate the elevation values along the profile. It can be configured to consume a custom profile task. Learn more about setting up your own Profile Service. " + "value": "This application uses the Elevation Analysis Profile Task to generate the elevation values along the profile. It can be configured to consume a custom profile task. Learn more about setting up your own Profile Service. " }, { "type": "string", "fieldName": "customProfileUrl", "label": "Custom profile url", "tooltip": "Custom profile service url", "placeHolder": "http://elevation.arcgis.com/arcgis/rest/services/Tools/ElevationSync/GPServer" - }, { - "type": "paragraph", - "value": "Specify custom colors for the elevation profile chart. Default color scheme is blue/gray" - }, { - "type": "color", - "fieldName": "axisFontColor", - "tooltip": "Choose text color for the axis", - "label": "Axis font color" - }, { - "type": "color", - "fieldName": "axisMajorTickColor", - "tooltip": "Choose tick color", - "label": "Axis major tick color" - }, { - "type": "color", - "fieldName": "elevationBottomColor", - "tooltip": "Specify bottom elevation color", - "label": "Elevation bottom color" - }, { - "type": "color", - "fieldName": "elevationTopColor", - "tooltip": "Specify top elevation color", - "label": "Elevation top color" - }, { - "type": "color", - "fieldName": "skyBottomColor", - "tooltip": "Specify sky bottom color", - "label": "Sky bottom color" - }, { - "type": "color", - "fieldName": "skyTopColor", - "tooltip": "Specify sky top color", - "label": "Sky top color" }] }, { "category": "Search", "fields": [{ + "type": "subcategory", + "label": "Search Settings" + }, { "type": "paragraph", "value": "Enable search to allow users to find a location or data in the map. Configure the search settings to refine the experience in your app by setting the default search resource, placeholder text, etc." }, { @@ -212,10 +224,10 @@ "fieldName": "searchConfig", "label": "Configure search tool" }] - }] - }, { - "category": "Custom URL Parameter", - "fields": [{ + }, { + "type": "subcategory", + "label": "Custom URL Parameter" + }, { "type": "paragraph", "value": "Setup the app to support a custom url parameter. For example if your map contains a feature layer with parcel information and you'd like to be able to find parcels using a url parameter you can use this section to do so. Select a layer and search field then define the name of a custom param. Once you've defined these values you can append the custom search to your application url using the custom parameter name you define. For example, if I set the custom param value to parcels a custom url would look like this index.html?parcel=3045" }, { @@ -236,36 +248,30 @@ "tooltip": "URL param search field" }], "layerOptions": { - "supportedTypes": [ - "FeatureLayer" - ], - "geometryTypes": [ - "esriGeometryPoint", - "esriGeometryLine", - "esriGeometryPolyline", - "esriGeometryPolygon" - ] + "supportedTypes": ["FeatureLayer"], + "geometryTypes": ["esriGeometryPoint", "esriGeometryLine", "esriGeometryPolyline", "esriGeometryPolygon"] } }] }], - "values": { + "values": { "splashModal": false, - "background": "#666", - "color": "#fff", - "legend": false, - "includelayeropacity": false, - "basemaps": false, - "basemapToggle": false, - "share": false, - "search": false, - "units": "english", - "backgroundOpacity": "0.9", - "panelLocation": "bottom-center", - "axisFontColor": "#fff", - "axisMajorTickColor": "#fff", - "elevationTopColor": "#8C8C8C", - "elevationBottomColor": "#696969", - "skyBottomColor": "#00B2EE", - "skyTopColor": "#009ACD" + "background": "#666", + "color": "#fff", + "legend": false, + "elevationDraw": true, + "includelayeropacity": false, + "basemaps": false, + "basemapToggle": false, + "share": false, + "search": false, + "units": "english", + "backgroundOpacity": "0.9", + "panelLocation": "bottom-center", + "axisFontColor": "#fff", + "axisMajorTickColor": "#fff", + "elevationTopColor": "#8C8C8C", + "elevationBottomColor": "#696969", + "skyBottomColor": "#00B2EE", + "skyTopColor": "#009ACD" } -} +} \ No newline at end of file