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

Eric Lemoine eric.c2c at gmail.com
Mon Sep 22 14:43:40 EDT 2008


Hi. How about that:

var vector = new OpenLayers.Layer.Vector("vector", {"styleMap": new
OpenLayers.StyleMap({"select": new OpenLayers.Style(yourStyle)})});

Eric

2008/9/22, Mark Nine <mbailen at usgs.gov>:
>
>
> This got me half-way there.
>
> When I select the feature, the style gets set, but when I begin to modify,
> the style disappears.  I tried setting/unsetting toggle and clickout, but
> they did not help.  Using FF 3 and OL 2.6.
>
> Any ideas?
>
> Thanks, Mark
>
>
>
>
>
> Andreas Hocevar-3 wrote:
>>
>> 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.
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Can%27t-set-style-for-ModifyFeature-control...-tp19520456p19612573.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list