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