worldBounds option for containsLonLat.
This is basically the same enhancement we made for intersectsBounds, and we no longer have to do dateline shifting in other components to get proper containsLonLat results.
This commit is contained in:
+2
-12
@@ -1940,18 +1940,8 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
var valid = false;
|
||||
if (lonlat != null) {
|
||||
var maxExtent = this.getMaxExtent();
|
||||
valid = maxExtent.containsLonLat(lonlat);
|
||||
if (!valid && this.baseLayer.wrapDateLine) {
|
||||
lonlat = lonlat.clone();
|
||||
var worldWidth = maxExtent.getWidth();
|
||||
while(lonlat.lon > maxExtent.right) {
|
||||
lonlat.lon -= worldWidth;
|
||||
valid = maxExtent.containsLonLat(lonlat);
|
||||
if (valid) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
var worldBounds = this.baseLayer.wrapDateLine && maxExtent;
|
||||
valid = maxExtent.containsLonLat(lonlat, {worldBounds: worldBounds});
|
||||
}
|
||||
return valid;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user