Update Control.OverviewMap.getOverviewPxFromLonLat input type
'lonlat' parameter can be either a OpenLayers.LonLat instance or a simple javascript object with a 'lon' and 'lat' properties.
This commit is contained in:
@@ -628,12 +628,14 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* translated into pixel bounds for the overview map
|
* translated into pixel bounds for the overview map
|
||||||
*/
|
*/
|
||||||
getRectBoundsFromMapBounds: function(lonLatBounds) {
|
getRectBoundsFromMapBounds: function(lonLatBounds) {
|
||||||
var leftBottomLonLat = new OpenLayers.LonLat(lonLatBounds.left,
|
var leftBottomPx = this.getOverviewPxFromLonLat({
|
||||||
lonLatBounds.bottom);
|
lon: lonLatBounds.left,
|
||||||
var rightTopLonLat = new OpenLayers.LonLat(lonLatBounds.right,
|
lat: lonLatBounds.bottom
|
||||||
lonLatBounds.top);
|
});
|
||||||
var leftBottomPx = this.getOverviewPxFromLonLat(leftBottomLonLat);
|
var rightTopPx = this.getOverviewPxFromLonLat({
|
||||||
var rightTopPx = this.getOverviewPxFromLonLat(rightTopLonLat);
|
lon: lonLatBounds.right,
|
||||||
|
lat: lonLatBounds.top
|
||||||
|
});
|
||||||
var bounds = null;
|
var bounds = null;
|
||||||
if (leftBottomPx && rightTopPx) {
|
if (leftBottomPx && rightTopPx) {
|
||||||
bounds = new OpenLayers.Bounds(leftBottomPx.x, leftBottomPx.y,
|
bounds = new OpenLayers.Bounds(leftBottomPx.x, leftBottomPx.y,
|
||||||
@@ -699,7 +701,8 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* Get a pixel location from a map location
|
* Get a pixel location from a map location
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* lonlat - {<OpenLayers.LonLat>}
|
* lonlat - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
||||||
|
* object with a 'lon' and 'lat' properties.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {Object} Location which is the passed-in OpenLayers.LonLat,
|
* {Object} Location which is the passed-in OpenLayers.LonLat,
|
||||||
|
|||||||
Reference in New Issue
Block a user