0

I have a KML file which contains multiple placemarks. I'm displaying this file on Google Maps following this description: https://developers.google.com/maps/documentation/javascript/kml

Is it possible, using the JavaScript API, to select only one placemark to be displayed?

1

You can not query/filter a KML Layer the way like you can filter Google Maps data layer (see reference to the Data class of the Maps API here: enter link description here)

In this case, give you have Placemarks in your KML only, why don't you AJAX that KML into your script and parse it to retrieve the coordinates and the attributes of the placemarks that are included into an array?

You can then transform that array into a Feature collection and pass it to a google maps data layer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.