Layer and tile API update.

The tile now has responsibility for resolving feature ids and fetching feature data given x, y pixel offsets with getFeatureId and getFeatureData methods.  The layer has corresponding getFeatureId and getFeatureData methods that take a map location, lookup the appropriate tile, and delegate to the tile for the rest of the work.
This commit is contained in:
Tim Schaub
2012-02-26 21:05:12 -07:00
parent fc03f57591
commit 551c582ab1
4 changed files with 134 additions and 31 deletions

View File

@@ -180,7 +180,7 @@ OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
for (var i=0, len=layers.length; i<len; i++) {
layer = layers[i];
idx = this.map.layers.indexOf(layer);
dataLookup[idx] = layer.getData(lonLat);
dataLookup[idx] = layer.getFeatureData(lonLat);
}
this.callback(dataLookup); // perhaps pass tile, lonLat?
}