ananse23/election-results — pull request #1 by phpmaps (2012-12-01 18:05:20+00:00)
Title: Sending label prototype along marking TODO areas

This work can be merged into the election app. Seemed easier to test labels in separate html file, since it's going to take a little bit of logic to make them scale dependent, like you suggested.

Also added scale dependency to the detailed election district layer...

function detailedFeatureLayerAction(fl) {
//TODO : Make fl var to a global or a property of app so it can be used in other functions
fl.minScale = 900000;
fl.maxScale = 100000;
var query = new esri.tasks.Query();
query.where = "1=1";
query.outFields = [ "*" ];
var geoms = [];

//TODO: Move below feature layer query logic to dojo.connect onExtentChange callback in init()
//so getLabelPoints will be called in a scale dependent fashion

fl.queryFeatures(query, function(featureSet) {
dojo.forEach(featureSet.features,function(feature){
geoms.push(feature.geometry);
});
getLabelPoints(geoms);
});

}