Hi,

jessisena wrote:
> Hi,
> Anybody knows if is possible to have two differents controls Draw feature,
> with the same kind of handler (for example point), and everyone with their
> own style? 
>
> That is, if I can have two controls that draw points with different styles,
> in the same layer.
>
> Thanks
>
>   

You could overwrite the activate and deactivate function of both your 
DrawFeatures control to add a "featureadded" listener to your layer. On 
"activate", register the event. On "deactivate", unregister the event. 
Both events could call a different function to add an attribute to the 
added feature, let's say "type", the first control adds "1" as a value, 
the second "2", then you would need to redraw the feature.

With all this, you could have a addUniqueValueRules to your layer's 
styleMap object to render your features differently, based on your 
"type" attribute.

Does this make sense ?

-- 
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev

Reply via email to