[OpenLayers-Users] PropertyStyles not working with WFS?

Christopher Schmidt crschmidt at metacarta.com
Sat Nov 1 18:51:21 EDT 2008


On Sun, Nov 02, 2008 at 12:32:41AM +0200, Lauri wrote:
> Hello,
> 
> I have a strange problem: PropertyStyles works with GML layers, but not
> with WFS - same GML code, same config.
> 
> > var symbolizer = OpenLayers.Util.applyDefaults(
> >         {externalGraphic: "img/${icon}", pointRadius: 20},
> >         OpenLayers.Feature.Vector.style["default"]);
> > var styleMap = new OpenLayers.StyleMap({default: symbolizer, select: {pointRadius: 30}});
> 
> WFS layer:
> > var layer = new OpenLayers.Layer.WFS('WFS', '/gml/', {}, { styleMap: styleMap });
> ...and browser requests "img/undefined".

WFS doesn't extract attibutes by default (because it's expensive): set
extractAttributes: true in the WFS options. 

> GML layer:
> > var layer = new OpenLayers.Layer.GML('GML', '/gml/', { styleMap: styleMap });
> 
> Regards,
> Lauri
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list