Update OpenLayers.Bounds.containsLonLat input type
'll' parameter can now be either a OpenLayers.LonLat instance or a simple javascript object with a 'lon' and 'lat' properties.
This commit is contained in:
@@ -359,7 +359,8 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
* APIMethod: containsLonLat
|
* APIMethod: containsLonLat
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ll - {<OpenLayers.LonLat>}
|
* ll - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
||||||
|
* object with a 'lon' and 'lat' properties.
|
||||||
* options - {Object} Optional parameters
|
* options - {Object} Optional parameters
|
||||||
*
|
*
|
||||||
* Acceptable options:
|
* Acceptable options:
|
||||||
@@ -382,13 +383,12 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
worldBounds = options.worldBounds;
|
worldBounds = options.worldBounds;
|
||||||
if (worldBounds && !contains) {
|
if (worldBounds && !contains) {
|
||||||
var worldWidth = worldBounds.getWidth();
|
var worldWidth = worldBounds.getWidth();
|
||||||
ll = ll.clone();
|
|
||||||
var worldCenterX = (worldBounds.left + worldBounds.right) / 2;
|
var worldCenterX = (worldBounds.left + worldBounds.right) / 2;
|
||||||
var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
|
var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
|
||||||
ll.lon -= (worldsAway * worldWidth);
|
contains = this.containsLonLat({
|
||||||
contains = this.containsLonLat(
|
lon: ll.lon - worldsAway * worldWidth,
|
||||||
ll, {inclusive: options.inclusive}
|
lat: ll.lat
|
||||||
);
|
}, {inclusive: options.inclusive});
|
||||||
}
|
}
|
||||||
return contains;
|
return contains;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -267,7 +267,8 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, {
|
|||||||
* Determins whether the feature intersects with the specified location.
|
* Determins whether the feature intersects with the specified location.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* lonlat - {<OpenLayers.LonLat>}
|
* lonlat - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
||||||
|
* object with a 'lon' and 'lat' properties.
|
||||||
* toleranceLon - {float} Optional tolerance in Geometric Coords
|
* toleranceLon - {float} Optional tolerance in Geometric Coords
|
||||||
* toleranceLat - {float} Optional tolerance in Geographic Coords
|
* toleranceLat - {float} Optional tolerance in Geographic Coords
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -176,7 +176,8 @@ OpenLayers.Geometry = OpenLayers.Class({
|
|||||||
* geometry.
|
* geometry.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* lonlat - {<OpenLayers.LonLat>}
|
* lonlat - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
||||||
|
* object with a 'lon' and 'lat' properties.
|
||||||
* toleranceLon - {float} Optional tolerance in Geometric Coords
|
* toleranceLon - {float} Optional tolerance in Geometric Coords
|
||||||
* toleranceLat - {float} Optional tolerance in Geographic Coords
|
* toleranceLat - {float} Optional tolerance in Geographic Coords
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user