I am using Google Maps JavaScript API v3. I want to wire up to the Google Maps, KmlLayer‘s KmlMouseEvent for all of the default places that show up when I create the map.
The only way I have found that gives me a reference to the KmlLayer is to create it. However, I want all the default data.
This post explains how to wire up to the KmlMouseEvent click if I am loading the KML from an external file. However, I can’t find any documentation in the API that allows me to access the click event of the default KmlLayer.
The best solution I’ve been able to come up with is to make a call to the Places API and generate a KML file from the returned data. There’s just got to be a better way.
1: First of all google maps v3 is not based on kml layer, so there is nothing default to get in kml
2: Even if it was kml based, getting default kml layer would not be possible given the current state of google maps, you may have to change the gooogle maps api, which is otherwise unrealistic. In other words you wont be using google maps actually.
Online Mapping with Google Maps API for your reference