Hi, There is a property selectStyle for the SelectFeatureControl.
It should also work, when the features have there own style. ctrlSelectFeature.selectStyle = OpenLayers.Feature.Vector.style['select']; Arnd -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von Jeff Dege Gesendet: Freitag, 29. April 2011 23:32 An: Andreas Hocevar Cc: [email protected] Betreff: RE: [OpenLayers-Users] Different renderIntents when features havedifferent styles? My problem is that I can only apply a StyleMap to a layer, and I need a different appearance for each feature. It looks, though, as if using a parameterized StyleMap, as the example shows, should work. I can the same StyleMap for all features, but have individual settings within it (strokecolor, fillcolor, etc.) determined by attributes on each feature. Thanks. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Andreas Hocevar Sent: Friday, April 29, 2011 3:32 AM To: Jeff Dege Cc: [email protected] Subject: Re: [OpenLayers-Users] Different renderIntents when features have different styles? Hi, If feature.style is set, it will always take precedence over layer styles. To achieve what you want, create a stylemap with a "default" and a "select" renderIntent. See http://openlayers.org/dev/examples/styles-rotation.html for an example that does this. Andreas. On Wed, Apr 27, 2011 at 6:37 PM, Jeff Dege <[email protected]> wrote: > I have a map with a vector layer. > > > > On that layer I am drawing a number of features. > > > > I want those features to have different appearances, so I am setting > the style attribute on each. > > > > I have a SelectControl, with which I am selecting features on the map. > I want the selected features to have a different appearance than the > unselected features. But I'm having problems with this. > > > > Inside Vector.drawFeature(), regardless of what renderIntent I have > set on the feature, or what my layer's styleMap may have, if the > feature has a style assigned, it looks like it's that style that is > used to render the feature, no matter what. > > > > I can set a StyleMap on the vector layer, so I can have selected > features drawn differently than unselected features, but this is > ignored if I set a style on the feature, itself. > > > > Any ideas on how I can get different features to draw on the same > layer, with different appearances, and still have their appearances > change when the user selects one? > > _______________________________________________ > Users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/openlayers-users > > -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
