Hi,
if you want different styles you have to do it in with layer and a styleMap. feature.style is really just an object with only the style-attributes in it. Like

{
      externalGraphic: iconUrl,
      graphicWidth: 18,
      graphicHeight: 18
   }


or

{
    display : "none"
  }

like here <http://trac.openlayers.org/wiki/Styles> under Basics, in your case var layer = OL.Layer.Vector('myStyledLayer', {styleMap:

{
'default' :
   {
      externalGraphic: iconUrl,
      graphicWidth: 18,
      graphicHeight: 18
   },
'delete' :
  {
    display : "none"
  }
}

}) ;
If you than want to set a feature to the "delete" style set feature.renderIntent = "delete".
I didn't try this example but I think this is what you want.
I hope for a clearer styling in OL 3.0, now it's little tricky. If you start and play around your first working code is with feature.style, but when you have than complicated styling it's a little strange to loose from it and dig deeper into layer.styleMap/SDL/rule/symbolizers. And it's "hard" because rules and symbolizers are so verbose especially with many different feature styles.
Regards,
Slawomir

Am 17.09.2010 21:28, schrieb ChiefDan:
Slawomir ,

Are you able to use a style setup like this with a feature.vector:

style = {
'default' :
    {
       externalGraphic: iconUrl,
       graphicWidth: 18,
       graphicHeight: 18
    },
'delete' :
   {
     display : "none"
   }
};

That does not work for me, although I may be doing something incorrect
again.

Dan

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to