Hi,
we fight in our project code now against feature.style, we used it before. If you write

this.style = {
     externalGraphic: iconUrl,
     graphicWidth: 18,
     graphicHeight: 18
    };

it should work(Didn't try this example but I think it should). It's a little "strange" or confusing that features need an simple object and layers the StyleMap/Style. We try symbolizers and rules for styling now. Andreas Hocevar gave me recently some very good hints. Look for "[OpenLayers-Users] OpenLayers.Feature.Vector style" in this mail list.
Regards
Slawomir


Am 17.09.2010 15:32, schrieb ChiefDan:
Is the style attribute in the Feature.Vector used at all?
I am creating features from a geoJSON file, one of the properties stored is
which icon to use to represent the feature. In my code, as I create the
Feature.Vector, I am setting the style similar to this(I'm using
feature.vector as a parent class):

    this.style = new OpenLayers.StyleMap( new OpenLayers.Style({
      externalGraphic: iconUrl,
      graphicWidth: 18,
      graphicHeight: 18
     }));

I attach all the features to a vector layer, and when it renders, there is
nothing on the map.
If I don't add the style, the default yellow circle is used.

Thanks for any hints!


Dan


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

Reply via email to