[OpenLayers-Users] get PK value in stylemap - bug?

Pedro Costa pedrocostaarma at sapo.pt
Fri Sep 20 08:35:23 PDT 2013


Hi,

I have this style:

'var style_pdi = new OpenLayers.StyleMap({
                             "default": new OpenLayers.Style({
                                 strokeColor: "#000000",
                                 strokeOpacity: .7,
                                 strokeWidth: 3,
                                 fillColor: "#ff0000",
                                 fillOpacity: 0,
                                 cursor: "pointer",
                                 label: "${nome}",
                                 externalGraphic: 
"/img/simbologia_layers/pdi/" + "${id}" + ".png"
                                 })....'

When I turn on the layer with this style, OL tries to open a image like 
that '.../undefined.png' despite getting the attribute id value.
If I use another attribute like 'name' works. Its some bug with PK? If i 
run
'>>> pontos_interesse_auditados.features[1].attributes.id'  in firebug 
all works well, i receive the id value. In this case 5.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130920/76e57edd/attachment.html>


More information about the Users mailing list