[OpenLayers-Users] Can Not Extract Attributes in KML File

reinaldo at geodesign.com.br reinaldo at geodesign.com.br
Fri Nov 9 06:27:11 PST 2012


OL Users,

Could some one please help?

I can not extract attributes in a KML file. Here is my KML:
         ba_uf
               ff0000ff
               0
                  2909901
                  Nordeste>
                  BAHIA>
                  0
               -39.492025999999996,-17.997105999999992 
This what I am using to extract and style the attributes:

..
        new OpenLayers.Layer.Vector("ESTADO DA BAHIA", {
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: "kml/ba_uf_900913a.kml",
                format: new OpenLayers.Format.KML({
                   extractStyles: false, 
                   extractAttributes: true,
                   srsName: "EPSG:900913"
                })
            }),
                style: {
                  fillColor: "#ffffff",
                  fillOpacity: 0,
                  strokeWidth: 1, 
                  strokeColor: "#0000ff", 
                  strokeOpacity: 1,
                  label: "S{State}",
                  fontColor: "#ffffff",
                  fontFamily: "sans-serif",
                  fontSize: "15px",
                  fontWeight: "bold"
                }
..

I want the attribute for State to be rendered on the map, but I only get
S{State} rendered.

I've tried additng  and label: "S{State}" or label: "S{State.value}" . I
get either S{State} or S{State.value} rendered on the map, but never the
actual attribute, which is BAHIA.

It has been suggested that I should add 
> ... ]]> in 

It just doesn't work. Could someone help please?

Thanks a lot in advance.

Reinaldo
------------------------------------
 Reinaldo Escada Chohfi
 Sócio Gerente
 GeoDesign Internacional
 www.geodesign.com.br (http://www.geodesign.com.br)
 Tel./Fax: (12) 3153-5115
 Inteligência e Tecnologia Espacial de Ponta

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121109/4a84c0dd/attachment.html>


More information about the Users mailing list