[OpenLayers-Users] Map controls properties

Ian iansgis at gmail.com
Thu Jun 26 14:20:37 EDT 2008


I'm working off of
http://openlayers.org/dev/examples/custom-control.htmland 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:

var query = new OpenLayers.Control();
                OpenLayers.Util.extend(query, {
                    draw: function () {
                        // this Handler.Box will intercept the
shift-mousedown
                        // before Control.MouseDefault gets to see it
                        this.box = new OpenLayers.Handler.Box(query,
                            {"done": this.notice},
                            {keyMask: OpenLayers.Handler.MOD_SHIFT});
                        this.box.activate();
                    },

                    notice: function (bounds) {
                        var ll = map.getLonLatFromPixel(new
OpenLayers.Pixel(bounds.left, bounds.bottom));
                        var ur = map.getLonLatFromPixel(new
OpenLayers.Pixel(bounds.right, bounds.top));
                        alert(ll.lon.toFixed(4) + ", " +
                              ll.lat.toFixed(4) + ", " +
                              ur.lon.toFixed(4) + ", " +
                              ur.lat.toFixed(4));
                    }
                });

function toggleControl (control) {
  if (control.value == 'query') {
    map.controls. ? .activate();
  } else {
    map.controls. ? .deactivate();
  }
}

I looked in the source but didn't see any property such as
'name','value',etc that I could reference in the toggleControl function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080626/3e266925/attachment.html


More information about the Users mailing list