AW: [OpenLayers-Users] Feature "style" and layer "styleMap"

Arnd Wippermann arnd.wippermann at web.de
Tue Aug 30 12:53:08 EDT 2011


Hi,

I'm not sure, if it's possible to add a default and select style to a
feature. 
But you can force the selectControl to use a select style of your choice.

var selectStyle = OpenLayers.Util.extend({},
OpenLayers.Feature.Vector.style['select']);
ctrlSelectFeature.selectStyle=selectStyle;


Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von gbrun
Gesendet: Dienstag, 30. August 2011 10:23
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] Feature "style" and layer "styleMap"

Hi everybody!

I've got a question about styles capabilities. I have a layer on which users
can draw features. At this layers, I assigned a "styleMap" property.

When a user has finished drawing a polygon on this layer for example, he can
select this one and change its color. For this, I use the "style"  
property of the drawn feature. It works fine, but then, the "styleMap"  
property of the layer doesn't apply at this feature anymore. This is a
problem, because the "styleMap" property defines a "select" style: this one
doesn't concern the feature which had its color changed anymore. So the user
can't see if he selected the feature or not! It seems that, if there is a
style applied to a feature, the styleMap isn't taken into account for this
feature anymore.

Does anyone know if there are some conflict between feature "style" and
layer "styleMap"?

Geoffrey
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list