Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 9 — Using Overlays 165


Listing 9-12: The XSL

<?xml version=”1.0” encoding=”ISO-8859-1” ?>
<xsl:stylesheet version=”1.0” ;
xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>





















Address








Phone





Listing 9-13 shows the necessary changes to the JavaScript to create the information window.


Listing 9-13: Creating an Info Window from XML and XSLT

function onLoad() {
if (GBrowserIsCompatible()) {
infopanel = document.getElementById(“infopanel”);
map = new GMap(document.getElementById(“map”));
map.centerAndZoom(new GPoint(-0.64,52.909444), 2);


var request = GXmlHttp.create();
Continued
Free download pdf