diff --git a/viewer/js/config/identify.js b/viewer/js/config/identify.js index a85fb35b1..7a6e81185 100644 --- a/viewer/js/config/identify.js +++ b/viewer/js/config/identify.js @@ -1,7 +1,8 @@ define([ 'dojo/i18n!./nls/main', - 'dojo/_base/lang' -], function (i18n, lang) { + 'dojo/_base/lang', + 'dojo/number' +], function (i18n, lang, number) { var linkTemplate = '{text}'; function directionsFormatter (noValue, attributes) { @@ -10,6 +11,7 @@ define([ text: 'Get Directions' }); } + return { map: true, mapClickMode: true, @@ -34,6 +36,22 @@ define([ // for details on pop-up definition see: https://developers.arcgis.com/javascript/jshelp/intro_popuptemplate.html identifies: { + cities: { + 0: { + fieldInfos: [{ + visible: true, + fieldName: 'CITY_NAME', + label: 'Name' + }, { + visible: true, + fieldName: 'POP', + label: 'Population', + formatter: function (value) { + return number.format(value); + } + }] + } + }, louisvillePubSafety: { 2: { title: i18n.identify.louisvillePubSafety.policeStation, diff --git a/viewer/js/config/nls/main.js b/viewer/js/config/nls/main.js index d4e18302b..2a9a8a606 100644 --- a/viewer/js/config/nls/main.js +++ b/viewer/js/config/nls/main.js @@ -22,6 +22,7 @@ define({ }, viewer: { operationalLayers: { + cities: 'World Cities', damageAssessment: 'Damage Assessment', louisvillePubSafety: 'Louisville Public Safety', restaurants: 'Restaurants', diff --git a/viewer/js/config/viewer.js b/viewer/js/config/viewer.js index d11dc7490..cd1b18bb1 100644 --- a/viewer/js/config/viewer.js +++ b/viewer/js/config/viewer.js @@ -159,7 +159,7 @@ define([ } }, { type: 'feature', - url: 'https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0', + url: 'https://sampleserver6.arcgisonline.com/ArcGIS/rest/services/SF311/FeatureServer/0', title: i18n.viewer.operationalLayers.sf311Incidents, options: { id: 'sf311Incidents', @@ -224,6 +224,14 @@ define([ iconClass: 'fa fa-smile-o' }] } + }, { + type: 'dynamic', + url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer', + title: i18n.viewer.operationalLayers.cities, + options: { + id: 'cities', + visible: false + } /* //examples of vector tile layers (beta in v3.15) }, { diff --git a/viewer/js/gis/dijit/Identify.js b/viewer/js/gis/dijit/Identify.js index ccae23bc5..50efe59f5 100644 --- a/viewer/js/gis/dijit/Identify.js +++ b/viewer/js/gis/dijit/Identify.js @@ -397,7 +397,7 @@ define([ getInfoTemplate: function (layer, layerId, result) { var popup, config; if (result) { - layerId = result.layerId || layer.layerId; + layerId = typeof result.layerId === 'number' ? result.layerId : layer.layerId; } else if (layerId === null) { layerId = layer.layerId; }