0

My ExtendedData element is following. I would like to read it the values for the two elements ("GeoRegionId" and "PolygonId").

<ExtendedData>
    <Data name="GeoRegionId">
        <value>1</value>
    </Data>
    <Data name="PolygonId">
        <value>132</value>
    </Data>
</ExtendedData>

To read the values i have done like the following.

function useTheData(doc) {
    geoXmlDoc = doc[0];
    console.log(' Length :_: ' + geoXmlDoc.placemarks.length);
    for (var i = 0; i < geoXmlDoc.placemarks.length; i++) {
        var mark = geoXmlDoc.placemarks[i];
        google.maps.event.addListener(mark.polygon, "click",
            function(event) {
                console.log(' GeoRegion Name :_: ' + mark.name);
                console.log(' GeoRegionId :_: ' + mark.ExtendedData);
                console.log(' Polygon Id :_: ' + mark.ExtendedData.getName(PolygonId));
                        });
    }
};

I can get GeoRegion Name. But failing to get GeoRegionId and PolygonId

BblackK
  • 524
  • 1
  • 8
  • 25
ArunRaj
  • 1,780
  • 2
  • 26
  • 48
  • 1
    are you using geoxml.js (if so, where from?) or [geoxml3.js](https://code.google.com/p/geoxml3/)? – geocodezip Apr 07 '14 at 19:28
  • @geocodezip : Yes You find the mistake. I am having wrong library. Now I am fixed it. I was used the following lib. http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js. It was the mistake. Now I have found this. https://code.google.com/p/geoxml3/source/browse/branches/kmz/geoxml3.js . As well as able to read the extended data by the following link . http://stackoverflow.com/questions/21537680/load-kml-extendeddata-into-variable-with-geoxml3 – ArunRaj Apr 08 '14 at 04:46

0 Answers0