Ignore:
Timestamp:
Dec 21, 2005, 6:16:36 PM (16 years ago)
Author:
Dominic Hargreaves
Message:

Add initial google maps support, see #46 but this isn't yet a complete
implementation so leaving the bug open for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/node.tt

    r729 r730  
    77[% IF oldid %]
    88<div id="redirect_message">(redirected from <a href="[% full_cgi_url %]?id=[% oldid %];redirect=0">[% oldid.replace('_', ' ') %]</a>)</div>
     9[% END %]
     10
     11[% IF wgs84_lat AND wgs84_long AND display_google_maps and gmaps_api_key %]
     12  <div id="map" style="float:right; width: 300px; height: 200px"></div>
     13  <script defer="defer" type="text/javascript">
     14  //<![CDATA[
     15    var map = new GMap(document.getElementById("map"));
     16    map.addControl(new GSmallMapControl());
     17    map.centerAndZoom(new GPoint([% longitude %], [% latitude %]), 3);
     18    var point0 = new GPoint([% wgs84_long %], [% wgs84_lat %]);
     19    var marker0 = new GMarker(point0,baseIcon);
     20    GEvent.addListener(marker0, "click", function() {
     21      marker0.openInfoWindowHtml("[% node_name %]");
     22      });
     23    map.addOverlay(marker0);
     24  //]]>
     25  </script>
    926[% END %]
    1027
Note: See TracChangeset for help on using the changeset viewer.