Do not change ol.extent.containsCoordinate

This commit is contained in:
ahocevar
2013-05-16 10:42:28 +02:00
parent 2d5c0df7cd
commit 824397e6ba
2 changed files with 13 additions and 18 deletions

View File

@@ -238,8 +238,14 @@ ol.renderer.canvas.VectorLayer.prototype.getFeatureInfoForPixel =
[[location[0] - halfWidth, location[1] - halfHeight],
[location[0] + halfWidth, location[1] + halfHeight]]);
coordinates = geom.getCoordinates();
if (ol.extent.containsCoordinate(symbolBounds, coordinates)) {
result.push(candidate);
if (!goog.isArray(coordinates[0])) {
coordinates = [coordinates];
}
for (j = coordinates.length - 1; j >= 0; --j) {
if (ol.extent.containsCoordinate(symbolBounds, coordinates[j])) {
result.push(candidate);
break;
}
}
} else if (goog.isFunction(geom.containsCoordinate)) {
// For polygons, check if the pixel location is inside the polygon