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

Fix dynamic layer identifies for sublayer id 0 #706

Merged
merged 7 commits into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 15 additions & 0 deletions viewer/js/config/identify.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ define([
// for details on pop-up definition see: https://developers.arcgis.com/javascript/jshelp/intro_popuptemplate.html

identifies: {
population: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking towards the future, I would like to avoid using services from sampleserver1 (and 2, 3, and 4). These older servers at version 10.0 are problematic for use with version 4.x (specifically when using 3D maps). This applies to the existing Louisville Public Safety service and SF 311 services as well. Public Safety Service is where the problems with 4.x surfaced.

For now, how about we remove or replace the Population service in this PR? (replace from sampleserver6?) Then we can replace the other out-of-date services in a separate PR. Thoughts?

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,
Expand Down
1 change: 1 addition & 0 deletions viewer/js/config/nls/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ define({
},
viewer: {
operationalLayers: {
population: 'Population density',
damageAssessment: 'Damage Assessment',
louisvillePubSafety: 'Louisville Public Safety',
restaurants: 'Restaurants',
Expand Down
7 changes: 7 additions & 0 deletions viewer/js/config/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion viewer/js/gis/dijit/Identify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down