[OpenLayers-Users] RegularPolygon Styling

Andreas Hocevar ahocevar at opengeo.org
Wed Sep 2 04:40:43 EDT 2009


Eric Lemoine wrote:
> On Tue, Aug 25, 2009 at 7:20 PM, Heidt, Christopher
> M.<CHRISTOPHER.M.HEIDT at saic.com> wrote:
>   
>> The "temporary" style that exists in the other shape handlers
>> doesn't seem to work with RegularPolygon.
>> How do I change the style of a RegularPolygon during the draw phase?
>>     
>
> Hi.
>
> Either write a patch to Handler/RegularPolygon.js so it takes the
> layerOptions config option into account (as Handler/Point.js does),

Such a patch already exists, it just needs some unit tests:
http://trac.openlayers.org/attachment/ticket/2232/openlayers-2232.patch

Regards,
Andreas.

>  or
> provide a style property to the regular polygon handler through the
> handlerOptions config option passed to the draw feature control:
>
> new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.RegularPolygon, {
>     handlerOptions: {
>         style: OpenLayers.Feature.Vector.style['temporary']
>     }
> });
>
>
> Hope this helps,
>
>
>
>   


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




More information about the Users mailing list