replace Pixel argument with simple object (Map.getLonLatFromPixel)
This commit is contained in:
@@ -299,12 +299,14 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
selectBox: function(position) {
|
||||
var bounds;
|
||||
if (position instanceof OpenLayers.Bounds) {
|
||||
var minXY = this.map.getLonLatFromPixel(
|
||||
new OpenLayers.Pixel(position.left, position.bottom)
|
||||
);
|
||||
var maxXY = this.map.getLonLatFromPixel(
|
||||
new OpenLayers.Pixel(position.right, position.top)
|
||||
);
|
||||
var minXY = this.map.getLonLatFromPixel({
|
||||
x: position.left,
|
||||
y: position.bottom
|
||||
});
|
||||
var maxXY = this.map.getLonLatFromPixel({
|
||||
x: position.right,
|
||||
y: position.top
|
||||
});
|
||||
bounds = new OpenLayers.Bounds(
|
||||
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
|
||||
);
|
||||
|
||||
@@ -535,12 +535,14 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
selectBox: function(position) {
|
||||
if (position instanceof OpenLayers.Bounds) {
|
||||
var minXY = this.map.getLonLatFromPixel(
|
||||
new OpenLayers.Pixel(position.left, position.bottom)
|
||||
);
|
||||
var maxXY = this.map.getLonLatFromPixel(
|
||||
new OpenLayers.Pixel(position.right, position.top)
|
||||
);
|
||||
var minXY = this.map.getLonLatFromPixel({
|
||||
x: position.left,
|
||||
y: position.bottom
|
||||
});
|
||||
var maxXY = this.map.getLonLatFromPixel({
|
||||
x: position.right,
|
||||
y: position.top
|
||||
});
|
||||
var bounds = new OpenLayers.Bounds(
|
||||
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
|
||||
);
|
||||
|
||||
@@ -63,10 +63,14 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
|
||||
if (position instanceof OpenLayers.Bounds) {
|
||||
var bounds;
|
||||
if (!this.out) {
|
||||
var minXY = this.map.getLonLatFromPixel(
|
||||
new OpenLayers.Pixel(position.left, position.bottom));
|
||||
var maxXY = this.map.getLonLatFromPixel(
|
||||
new OpenLayers.Pixel(position.right, position.top));
|
||||
var minXY = this.map.getLonLatFromPixel({
|
||||
x: position.left,
|
||||
y: position.bottom
|
||||
});
|
||||
var maxXY = this.map.getLonLatFromPixel({
|
||||
x: position.right,
|
||||
y: position.top
|
||||
});
|
||||
bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
|
||||
maxXY.lon, maxXY.lat);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user