dingus
dingus

Reputation: 11

Get placemark names from kml layer in google maps api

I have created a google map and am linking to a kml layer (shown below) in order to create the placemarks. I am trying to do two things:

  1. Get the name of each placemark and write it out in a div on the page.
  2. link the hover states of the placemark on the map and the respective name in the div, so that when either is hovered over, both have a hover state.

layers = new google.maps.KmlLayer('url of kml file is here', { preserveViewport: true });

Upvotes: 1

Views: 1863

Answers (1)

geocodezip
geocodezip

Reputation: 161404

Can't do either with KmlLayer. Look at using a third party KML parser like geoxml3 or geoxml-v3; or importing your KML into a FusionTable and using a FusionTablesLayer and querying the table for the sidebar and hover information.

example using geoxml3

Upvotes: 1

Related Questions