OverviewMap.getOverviewPxFromLonLat: return simple object instead of OpenLayers.Pixel
This commit is contained in:
@@ -702,19 +702,18 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
||||
* lonlat - {<OpenLayers.LonLat>}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Pixel>} Location which is the passed-in OpenLayers.LonLat,
|
||||
* {Object} Location which is the passed-in OpenLayers.LonLat,
|
||||
* translated into overview map pixels
|
||||
*/
|
||||
getOverviewPxFromLonLat: function(lonlat) {
|
||||
var res = this.ovmap.getResolution();
|
||||
var extent = this.ovmap.getExtent();
|
||||
var px = null;
|
||||
if (extent) {
|
||||
px = new OpenLayers.Pixel(
|
||||
Math.round(1/res * (lonlat.lon - extent.left)),
|
||||
Math.round(1/res * (extent.top - lonlat.lat)));
|
||||
return {
|
||||
x: Math.round(1/res * (lonlat.lon - extent.left)),
|
||||
y: Math.round(1/res * (extent.top - lonlat.lat))
|
||||
};
|
||||
}
|
||||
return px;
|
||||
},
|
||||
|
||||
CLASS_NAME: 'OpenLayers.Control.OverviewMap'
|
||||
|
||||
Reference in New Issue
Block a user