GetFeature doesn't handle Handler.Box case when result of user interaction is a pixel, patch by bjornharrtell, r=me (closes #2256)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9768 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2009-10-30 14:28:54 +00:00
parent 6839605b0f
commit 5119ffa50e

View File

@@ -273,6 +273,7 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
* position - {<OpenLayers.Bounds>}
*/
selectBox: function(position) {
var bounds;
if (position instanceof OpenLayers.Bounds) {
var minXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.left, position.bottom)
@@ -280,12 +281,16 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, {
var maxXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.right, position.top)
);
var bounds = new OpenLayers.Bounds(
bounds = new OpenLayers.Bounds(
minXY.lon, minXY.lat, maxXY.lon, maxXY.lat
);
this.setModifiers(this.handlers.box.dragHandler.evt);
this.request(bounds);
} else {
bounds = this.pixelToBounds(position);
this.setModifiers(this.handlers.box.dragHandler.evt);
this.request(bounds);
}
},