Hi,
I have a kml-layer with attributes. In the KML-file the attributes are stored in ExtendedData/Data tag, so OL parses an attribute into feat.attributes.attrib1 as object with value and displayName attributes. Now I want that OL shows the value of one of the attributes as labels. To do sos I would like to use the "${attribName}" notation but with KML-parsed attributes it should be something like this "${attribName.value}" but it's not working. I think I could implement to follow the point to the attribute of the attribute myself, but I would like to know if someone has done it before, if there is another solution or if there is another common way to do this.
My code looks like:

this.layer.styleMap =new  OpenLayers.StyleMap({
                    "default":new  OpenLayers.Style({
                        pointRadius: 6,
                        fillColor:"#666666",
                        strokeColor:"#00FF00",
                        labelAlign:"lb",
                        label:"${"  + jQuery(this.viewSelect).val() +"}"
                    }),
                });
It would be cool if it would work like this:
this.layer.styleMap =new  OpenLayers.StyleMap({
                    "default":new  OpenLayers.Style({
                        pointRadius: 6,
                        fillColor:"#666666",
                        strokeColor:"#00FF00",
                        labelAlign:"lb",
                        label:"${"  + jQuery(this.viewSelect).val() +".value}"
                    }),
                });

Could someone tell me why, if I run the first code above, the labels are "${attribName}"? But this is not so important, if I have to implement it myself I will find out:)
Regards,
Slawomir

--
-----------------------------------------------
Slawomir Messner
Forschungszentrum "Deutscher Sprachatlas"


_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev

Reply via email to