Search code examples
google-mapsgoogle-maps-api-3geoxml3geoxml

get path from kml geoxml3


I am working with google maps and using geoxml3 to parse my kml string and its showing on Google maps , now I want to get lines info like number of lines in kml string and its location can i get the info of lines drawn by parsed kml string?

html

<div id="map" style="height: 720px"></div>

app.ts

function parseKml() {

    var myParser = new geoXML3.parser({map: map});
    myParser.parseKmlString(kmlString);


  }

Solution

  • we can get description related to kml string/file by :

    myParser.docs[0].placemarks[0]
    myParser.docs[0].placemarks[1]
    myParser.docs[0].placemarks[2]
    

    use it accordingly as I have three lines