Skip to content

Instantly share code, notes, and snippets.

@kcarrier
Created December 11, 2015 14:59
Show Gist options
  • Save kcarrier/3189b246bf889bb68ca9 to your computer and use it in GitHub Desktop.
Save kcarrier/3189b246bf889bb68ca9 to your computer and use it in GitHub Desktop.
define([
//'dojo/_base/lang',
'esri/InfoTemplate'
], function (InfoTemplate) {
var formatters = {
attributeList: function (identifyResults) {
var features = [];
var template;
if (identifyResults) {
if (identifyResults.attributes.ZONE == '0-0') {
template = template00;
}
else if (identifyResults.attributes.ZONE == '0-1') {
template = template01;
}
else if (identifyResults.attributes.ZONE == '0-2') {
template = template02;
}
else if (identifyResults.attributes.ZONE == '1-1') {
var template11 = new InfoTemplate();
template11.title = '<b>The location of the red flag<br/>has the following options</b>';
template11.content = '<b>Primary School Options: </b><br/>' + '{ES1516WEB}';
template = template11;
}
else if (identifyResults.attributes.ZONE == '4-2') {
template = template42;
}
for (var i = 0; i < identifyResults.features.length; i++) {
identifyResults.features[i].setInfoTemplate(template);
features.push(identifyResults.features[i]);
}
return features;
}
}
};
return {
map: true,
mapClickMode: true,
mapRightClickMenu: true,
identifyLayerInfos: true,
identifyTolerance: 5,
identifies: {
qrylyr: {
2: {
title: 'Zone',
content: formatters.attributeList
}
}
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment