Skip to content

Instantly share code, notes, and snippets.

@mhulse
Created September 25, 2011 23:54
Show Gist options
  • Select an option

  • Save mhulse/1241336 to your computer and use it in GitHub Desktop.

Select an option

Save mhulse/1241336 to your computer and use it in GitHub Desktop.
Google Maps v3 geoXML infoWindow HTML in external DIV example...
var options = {
map: map,
singleInfoWindow: true,
// suppressInfoWindows: true, // If "false", then no access to infoWindow html. :(
createMarker: myCreateMarker
};
var overlay = new geoXML3.parser(options);
overlay.parse('http://foo.com/data.kml?v=' + parseInt(Math.random()*99999999));
function myCreateMarker(placemark) {
marker = overlay.createMarker(placemark);
google.maps.event.addListener(marker, 'click', function() {
console.log(marker);
marker.infoWindow.close();
var text = marker.infoWindow.getContent();
showInDiv(text);
});
};
function showInDiv(text) {
var sidediv = document.getElementById('contentWindow');
sidediv.innerHTML = text;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment