Skip to content

Instantly share code, notes, and snippets.

@kcarrier
Created December 11, 2015 15:57
Show Gist options
  • Save kcarrier/75a81784dd2a9af44242 to your computer and use it in GitHub Desktop.
Save kcarrier/75a81784dd2a9af44242 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') {
var template00 = new InfoTemplate();
template00.title = '<b>The location of the red flag<br/>has the following options</b>';
template00.content = '<b>Primary School Options: </b><br/><a href="' + identifyResults.attributes.ES1516WEB + '">' + identifyResults.attributes.ES1516_REV + '</a>' +
'<br/><a href="' + identifyResults.attributes.MS2015WEB + '">' + identifyResults.attributes.MSPlan2015 + '</a>' +
'<br/><a href="' + identifyResults.attributes.HSWEBSITE + '">' + identifyResults.attributes.HS_2010_11 + '</a>' +
'<br/><b>Countywide Magnet/Charter Options:</b>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Charters Website</a>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Magnets Website</a>';
template = template00;
}
else if (identifyResults.attributes.ZONE == '0-1') {
var template01 = new InfoTemplate();
template01.title = '<b>The location of the red flag<br/>has the following options</b>';
template01.content = '<b>Primary School Options: </b><br/><a href="' + identifyResults.attributes.ES1516WEB + '">' + identifyResults.attributes.ES1516_REV + '</a>' +
'<br/><a href="' + identifyResults.attributes.MS2015WEB + '">' + identifyResults.attributes.MSPlan2015 + '</a>' +
'<br/><a href="' + identifyResults.attributes.HSWEBSITE + '">' + identifyResults.attributes.HS_2010_11 + '</a>' +
'<br/><b>Constituent District Magnet Options:</b>' +
'<br/><a href="' + identifyResults.attributes.CONST1WEB + '">' + identifyResults.attributes.CONST1 + '</a>' +
'<br/><b>Partial Magnet Options:</b>' +
'<br/><a href="' + identifyResults.attributes.PARTMWEB1 + '">' + identifyResults.attributes.PARTMAG1 + '</a>' +
'<br/><b>Countywide Magnet/Charter Options:</b>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Charters Website</a>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Magnets Website</a>';
template = template01;
}
else if (identifyResults.attributes.ZONE == '0-2') {
var template02 = new InfoTemplate();
template02.title = '<b>The location of the red flag<br/>has the following options</b>';
template02.content = '<b>Primary School Options: </b><br/><a href="' + identifyResults.attributes.ES1516WEB + '">' + identifyResults.attributes.ES1516_REV + '</a>' +
'<br/><a href="' + identifyResults.attributes.MS2015WEB + '">' + identifyResults.attributes.MSPlan2015 + '</a>' +
'<br/><a href="' + identifyResults.attributes.HSWEBSITE + '">' + identifyResults.attributes.HS_2010_11 + '</a>' +
'<br/><b>Partial Magnet Options:</b>' +
'<br/><a href="' + identifyResults.attributes.PARTMWEB1 + '">' + identifyResults.attributes.PARTMAG1 + '</a>' +
'<br/><a href="' + identifyResults.attributes.PARTMWEB2 + '">' + identifyResults.attributes.PARTMAG2 + '</a>' +
'<br/><b>Countywide Magnet/Charter Options:</b>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Charters Website</a>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Magnets Website</a>';
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/><a href=' + identifyResults.attributes.ES1516WEB + '>' + identifyResults.attributes.ES1516_REV + '</a>' +
'<br/><a href="' + identifyResults.attributes.MS2015WEB + '">' + identifyResults.attributes.MSPlan2015 + '</a>' +
'<br/><a href="' + identifyResults.attributes.HSWEBSITE + '">' + identifyResults.attributes.HS_2010_11 + '</a>' +
'<br/><b>Constituent District Magnet Options:</b>' +
'<br/><a href="' + identifyResults.attributes.CONST1WEB + '">' + identifyResults.attributes.CONST1 + '</a>' +
'<br/><b>Partial Magnet Options:</b>' +
'<br/><a href="' + identifyResults.attributes.PARTMWEB1 + '">' + identifyResults.attributes.PARTMAG1 + '</a>' +
'<br/><b>Countywide Magnet/Charter Options:</b>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Charters Website</a>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Magnets Website</a>';
template = template11;
}
else if (identifyResults.attributes.ZONE == '4-2') {
var template42 = new InfoTemplate();
template42.title = '<b>The location of the red flag<br/>has the following options</b>';
template42.content = '<b>Primary School Options: </b><br/><a href="' + identifyResults.attributes.ES1516WEB + '">' + identifyResults.attributes.ES1516_REV + '</a>' +
'<br/><a href="' + identifyResults.attributes.MS2015WEB + '">' + identifyResults.attributes.MSPlan2015 + '</a>' +
'<br/><a href="' + identifyResults.attributes.HSWEBSITE + '">' + identifyResults.attributes.HS_2010_11 + '</a>' +
'<br/><b>Constituent District Magnet Options:</b>' +
'<br/><a href="' + identifyResults.attributes.CONST1WEB + '">' + identifyResults.attributes.CONST1 + '</a>' +
'<br/><a href="' + identifyResults.attributes.CONST2WEB + '">' + identifyResults.attributes.CONST2 + '</a>' +
'<br/><a href="' + identifyResults.attributes.CONST3WEB + '">' + identifyResults.attributes.CONST3 + '</a>' +
'<br/><a href="' + identifyResults.attributes.CONST4WEB + '">' + identifyResults.attributes.CONST4 + '</a>' +
'<br/><b>Partial Magnet Options:</b>' +
'<br/><a href="' + identifyResults.attributes.PARTMWEB1 + '">' + identifyResults.attributes.PARTMAG1 + '</a>' +
'<br/><a href="' + identifyResults.attributes.PARTMWEB2 + '">' + identifyResults.attributes.PARTMAG2 + '</a>' +
'<br/><b>Countywide Magnet/Charter Options:</b>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Charters Website</a>' +
'<br/><a href="http://www.ccsdschools.com/Schools/Charter.php">Magnets Website</a>';
template = template42;
}
return template.content;
}
}
};
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