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) {
|
selectBox: function(position) {
|
||||||
var bounds;
|
var bounds;
|
||||||
if (position instanceof OpenLayers.Bounds) {
|
if (position instanceof OpenLayers.Bounds) {
|
||||||
var minXY = this.map.getLonLatFromPixel(
|
var minXY = this.map.getLonLatFromPixel({
|
||||||
new OpenLayers.Pixel(position.left, position.bottom)
|
x: position.left,
|
||||||
);
|
y: position.bottom
|
||||||
var maxXY = this.map.getLonLatFromPixel(
|
});
|
||||||
new OpenLayers.Pixel(position.right, position.top)
|
var maxXY = this.map.getLonLatFromPixel({
|
||||||
);
|
x: position.right,
|
||||||
|
y: position.top
|
||||||
|
});
|
||||||
bounds = new OpenLayers.Bounds(
|
bounds = new OpenLayers.Bounds(
|
||||||
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
|
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -535,12 +535,14 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
*/
|
*/
|
||||||
selectBox: function(position) {
|
selectBox: function(position) {
|
||||||
if (position instanceof OpenLayers.Bounds) {
|
if (position instanceof OpenLayers.Bounds) {
|
||||||
var minXY = this.map.getLonLatFromPixel(
|
var minXY = this.map.getLonLatFromPixel({
|
||||||
new OpenLayers.Pixel(position.left, position.bottom)
|
x: position.left,
|
||||||
);
|
y: position.bottom
|
||||||
var maxXY = this.map.getLonLatFromPixel(
|
});
|
||||||
new OpenLayers.Pixel(position.right, position.top)
|
var maxXY = this.map.getLonLatFromPixel({
|
||||||
);
|
x: position.right,
|
||||||
|
y: position.top
|
||||||
|
});
|
||||||
var bounds = new OpenLayers.Bounds(
|
var bounds = new OpenLayers.Bounds(
|
||||||
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
|
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -63,10 +63,14 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
if (position instanceof OpenLayers.Bounds) {
|
if (position instanceof OpenLayers.Bounds) {
|
||||||
var bounds;
|
var bounds;
|
||||||
if (!this.out) {
|
if (!this.out) {
|
||||||
var minXY = this.map.getLonLatFromPixel(
|
var minXY = this.map.getLonLatFromPixel({
|
||||||
new OpenLayers.Pixel(position.left, position.bottom));
|
x: position.left,
|
||||||
var maxXY = this.map.getLonLatFromPixel(
|
y: position.bottom
|
||||||
new OpenLayers.Pixel(position.right, position.top));
|
});
|
||||||
|
var maxXY = this.map.getLonLatFromPixel({
|
||||||
|
x: position.right,
|
||||||
|
y: position.top
|
||||||
|
});
|
||||||
bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
|
bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
|
||||||
maxXY.lon, maxXY.lat);
|
maxXY.lon, maxXY.lat);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user