That's kind of where I dead ended. google.maps.event.addListener(kmlLayer, 'click', function(kmlEvent) { var name = kmlEvent.featureData.name; var text = kmlEvent.featureData.description; var pos = kmlEvent.latLng; var offset = kmlEvent.pixelOffset; alert(name); showInFormatedInfoWindow(name, text, pos, offset); });
function showInFormatedInfoWindow(name, text, position, offset) { iw.setOptions({ content: "<div class='infowindow'><b>" + name + "<\/b><p>" + text + "<\/p><\/div>", position: position, pixelOffset: offset }); iw.open(map); } I ended up getting undefined values for kmlEvent.featureData.name and kmlEvent.featureData.description. Not sure if there is a problem with my kml file or not. I converted it from a standard ESRI shapefile using QGIS. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/X1MYxb_TSo0J. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.