[OpenLayers-Users] Using Control.GetFeature with box:true, can this be a Regular Polygon instead?

Planet_x andrew.stewart at reddeer.ca
Thu Dec 29 15:03:36 EST 2011


I have a working OpenLayers.Control.GetFeature, it is successfully grabbing
features with the box:true when I hold down and select the features within a
box. I need to get a regular polygon to work the same way the box does, is
this possible? 

The original example I found located here - 
http://openlayers.org/dev/examples/getfeature-wfs.html

Is only using the box, however I did find this patch -
http://trac.osgeo.org/openlayers/ticket/2149 Which seems allow line and
regularpolygon except I have tried to modify my version and cannot figure
this out. Any ideas on how I can use this control with a regular polygon or
freehand line? A regular polygon would be preferable. Appreciate any
assistance or advice!

Here is my currently working code for using a box to select features that I
wish to change to use a regular polygon.

select_control = new OpenLayers.Control.GetFeature({
        protocol: protocol_select,
        box: true,
        id: "select_by_square",
        hover: false,
        id: "select_feature",
        multipleKey: "shiftKey",
        toggleKey: "ctrlKey",
        maxFeatures: 1
    });

select_control.events.register("featuresselected", this, function (b) 
    {
         alert('feature selected');
    }

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Using-Control-GetFeature-with-box-true-can-this-be-a-Regular-Polygon-instead-tp7136619p7136619.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list