[OpenLayers-Users] Can't set style for ModifyFeature control...

Andreas Hocevar ahocevar at opengeo.org
Sun Sep 21 06:35:41 EDT 2008


Hi,

On Fri, Sep 19, 2008 at 10:18 PM, Mark Nine <mbailen at usgs.gov> wrote:
> I'm having difficulty setting the "select" style for the ModifyFeature
> Control. The documentation for ModifyFeature has a property for virtualStyle
> (which sets the style for the vertices and works for me), but not
> selectStyle. Do I need to create a SelectFeature Control along with my
> ModifyFeature Control?
>
> edit = new OpenLayers.Control.ModifyFeature(boundingBoxLayer, {selectStyle:
> green_style, mode: OpenLayers.Control.ModifyFeature.RESHAPE});

Instead, try:

edit = new OpenLayers.Control.ModifyFeature(boundingBoxLayer, {
    mode: OpenLayers.Control.ModifyFeature.RESHAPE}
);
edit.selectControl.selectStyle = green_style;

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list