I'm working off of <a href="http://openlayers.org/dev/examples/custom-control.html">http://openlayers.org/dev/examples/custom-control.html</a> and I'd like to send the bbox result to a WMS query for multiple feature selection. I'm using a radio list to let the user switch between zoom and multiple feature query drag box behavior, which activates/deactivates the custom control:<br>
<br>var query = new OpenLayers.Control();<br> OpenLayers.Util.extend(query, {<br> draw: function () {<br> // this Handler.Box will intercept the shift-mousedown<br>
// before Control.MouseDefault gets to see it<br> this.box = new OpenLayers.Handler.Box(query,<br> {"done": this.notice},<br> {keyMask: OpenLayers.Handler.MOD_SHIFT});<br>
this.box.activate();<br> },<br><br> notice: function (bounds) {<br> var ll = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.left, bounds.bottom)); <br>
var ur = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.right, bounds.top)); <br> alert(ll.lon.toFixed(4) + ", " + <br> ll.lat.toFixed(4) + ", " + <br>
ur.lon.toFixed(4) + ", " + <br> ur.lat.toFixed(4));<br> }<br> });<br><br>function toggleControl (control) { <br> if (control.value == 'query') {<br>
map.controls. ? .activate();<br> } else {<br> map.controls. ? .deactivate();<br> }<br>}<br><br>I looked in the source but didn't see any property such as 'name','value',etc that I could reference in the toggleControl function.<br>