Created
September 25, 2011 23:54
-
-
Save mhulse/1241336 to your computer and use it in GitHub Desktop.
Google Maps v3 geoXML infoWindow HTML in external DIV example...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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