[Firebug-cvs] firebug/web geocodeinfo_rfs.xsl,NONE,1.1 google_map_example.html,NONE,1.1 google_map_r
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2005-06-07 00:44:49
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4122 Added Files: geocodeinfo_rfs.xsl google_map_example.html google_map_rfs.html google_rfs.xml sidepanel.xsl Log Message: Added some google map scripting. --- NEW FILE: google_map_example.html --- <html> <head> <title>Demo Two for Unofficial Google Maps Embedding How To</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("google_rfs.xml", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> <p><dl> <dt style="font-weight:bold;">Container div</dt> <dd>The <tt><div></tt> where the map should be displayed.</dd> <dt style="font-weight:bold;">Panel div</dt> <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> <dt style="font-weight:bold;">Metapanel div</dt> <dd>It appears Gmaps uses this to display error and other messages</dd> <dt style="font-weight:bold;">Permalink div</dt> <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> <dt style="font-weight:bold;">Toggle div</dt> <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> <dt style="font-weight:bold;">Printheader div</dt> <dd>Presumably displayed at the head of a printed map.</dd> </dl> </p> <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> <p style="font-size:x-small;">26 May 2005<!--25 May 2005--></p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel"></div> <div id="permalink"></div> <div id="printheader"></div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: google_map_rfs.html --- <html> <head> <title>Demo Two for Unofficial Google Maps Embedding How To</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("google_rfs.xml", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> <p><dl> <dt style="font-weight:bold;">Container div</dt> <dd>The <tt><div></tt> where the map should be displayed.</dd> <dt style="font-weight:bold;">Panel div</dt> <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> <dt style="font-weight:bold;">Metapanel div</dt> <dd>It appears Gmaps uses this to display error and other messages</dd> <dt style="font-weight:bold;">Permalink div</dt> <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> <dt style="font-weight:bold;">Toggle div</dt> <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> <dt style="font-weight:bold;">Printheader div</dt> <dd>Presumably displayed at the head of a printed map.</dd> </dl> </p> <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> <p style="font-size:x-small;">26 May 2005<!--25 May 2005--></p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel"></div> <div id="permalink"></div> <div id="printheader"></div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: sidepanel.xsl --- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> <xsl:template match="location"> <table> <tr style="cursor:pointer" onclick="showLocationInfo('{@id}')"> <xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute> <xsl:if test="icon/@class != 'noicon'"> <td style="vertical-align: top; padding-right: 4px;"> <img style="width:24px; height:38px" alt=""> <!-- <xsl:attribute name="src">http://maps.google.com/mapfiles/icon.png</xsl:attribute> --> <xsl:attribute name="src"> <xsl:if test="icon/@image != 'http://maps.google.com/mapfiles/marker.png'"> <xsl:value-of select="icon/@image"/> </xsl:if> <xsl:if test="icon/@image = 'http://maps.google.com/mapfiles/marker.png'"> http://maps.google.com/mapfiles/icon.png </xsl:if> </xsl:attribute> </img> </td> </xsl:if> <td style="padding-bottom: 0.5em; padding-top: 1px; padding-left: 4px"> <xsl:if test="info/title"> <xsl:attribute name="class">label</xsl:attribute> <div> <xsl:choose> <xsl:when test="icon/@class != 'noicon'"> <a href="javascript:void(0)" onclick="this.blur()"> <xsl:attribute name="style">color: #0000cc</xsl:attribute> <xsl:copy-of select="info/title/node()"/> </a> </xsl:when> <xsl:otherwise> <xsl:attribute name="style">font-weight: bold</xsl:attribute> <xsl:copy-of select="info/title/node()"/> </xsl:otherwise> </xsl:choose> </div> </xsl:if> <xsl:apply-templates select="info/address/line"/> </td> </tr> </table> </xsl:template> <xsl:template match="line"> <div> <xsl:value-of select="."/> </div> </xsl:template> </xsl:stylesheet> --- NEW FILE: google_rfs.xml --- <?xml version="1.0"?> <page> <title>Custom XSL Demo</title> <query>Why?</query> <request/> <center lat="37.9" lng="-122.33"/> <span lat="0.017998" lng="0.027586"/> <overlay panelStyle="sidepanel.xsl"> <location infoStyle="geocodeinfo_rfs.xsl" id="A"> <point lat="37.9" lng="-122.33"/> <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"> </title> <address> <line>Mr G. Oogle</line> </address> <image> http://www.google.co.nz/images/logo_sm.gif </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="B"> <point lat="37.9" lng="-122.33"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> <address> <line>Here be spiders...</line> </address> <image> http://libgmail.sourceforge.net/spider.png </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="C"> <point lat="37.9" lng="-122.33"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve"/> <address> <line>Some address</line> </address> <image> http://libgmail.sourceforge.net/man.png </image> </info> </location> </overlay> </page> --- NEW FILE: geocodeinfo_rfs.xsl --- <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> <xsl:template match="location"> <div style="padding-right: 8px; margin-top: 2px"> <xsl:apply-templates select="info"/> </div> </xsl:template> <xsl:template match="info"> <xsl:variable name="page" select="../@arg0"/> <xsl:variable name="address"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:variable> <div style="font-weight: bold">Custom!</div> <div> <img> <xsl:attribute name="src"> <xsl:value-of select="image"/> </xsl:attribute> </img> </div> <div style="font-size: small; margin-top: 14px"> <xsl:apply-templates select="address/line"/> </div> </xsl:template> <xsl:template match="line"> <div style="margin-top: 2px"><xsl:value-of select="."/></div> </xsl:template> <xsl:template name="getSingleLineAddress"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> |