diff --git a/viewer/js/config/identify.js b/viewer/js/config/identify.js index a85fb35b1..4f177aba0 100644 --- a/viewer/js/config/identify.js +++ b/viewer/js/config/identify.js @@ -34,6 +34,21 @@ define([ // for details on pop-up definition see: https://developers.arcgis.com/javascript/jshelp/intro_popuptemplate.html identifies: { + population: { + 0: { + fieldInfos: [{ + visible: true, + fieldName: 'Pixel value', + alias: 'Population' + }, { + visible: true, + fieldName: 'Rounded Value', + formatter: function (none, attrs) { + return Math.round(attrs['Pixel value'] * 100) / 100; + } + }] + } + }, 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..832c49b36 100644 --- a/viewer/js/config/nls/main.js +++ b/viewer/js/config/nls/main.js @@ -22,6 +22,7 @@ define({ }, viewer: { operationalLayers: { + population: 'Population density', 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..ea950e6a7 100644 --- a/viewer/js/config/viewer.js +++ b/viewer/js/config/viewer.js @@ -175,6 +175,13 @@ define([ iconClass: 'fa fa-smile-o' }] } + }, { + type: 'dynamic', + url: 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer', + title: i18n.viewer.operationalLayers.population, + options: { + id: 'population' + } }, { type: 'dynamic', url: 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer', 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; }