Call getUid once

This commit is contained in:
Tim Schaub
2013-08-27 16:22:24 -06:00
parent 6b625e368b
commit e9aa316007
@@ -266,7 +266,7 @@ ol.renderer.canvas.VectorLayer.prototype.getFeaturesForPixel =
} }
var candidate, geom, type, symbolBounds, symbolSize, symbolOffset, var candidate, geom, type, symbolBounds, symbolSize, symbolOffset,
halfWidth, halfHeight, coordinates, j; halfWidth, halfHeight, uid, coordinates, j;
for (var id in candidates) { for (var id in candidates) {
candidate = candidates[id]; candidate = candidates[id];
geom = candidate.getGeometry(); geom = candidate.getGeometry();
@@ -275,8 +275,9 @@ ol.renderer.canvas.VectorLayer.prototype.getFeaturesForPixel =
type === ol.geom.GeometryType.MULTIPOINT) { type === ol.geom.GeometryType.MULTIPOINT) {
// For points, check if the pixel coordinate is inside the candidate's // For points, check if the pixel coordinate is inside the candidate's
// symbol // symbol
symbolSize = symbolSizes[goog.getUid(candidate)]; uid = goog.getUid(candidate);
symbolOffset = symbolOffsets[goog.getUid(candidate)]; symbolSize = symbolSizes[uid];
symbolOffset = symbolOffsets[uid];
halfWidth = symbolSize[0] / 2; halfWidth = symbolSize[0] / 2;
halfHeight = symbolSize[1] / 2; halfHeight = symbolSize[1] / 2;
symbolBounds = ol.extent.boundingExtent([ symbolBounds = ol.extent.boundingExtent([