Posted by Anonymous Thu 8th Mar 2007 12:37 - Syntax is HTML (4.0.1) - 100 views
Download | New Post | Modify | Hide line numbers
  1.  
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. xmlns="http://www.w3.org/1999/xhtml">
  4.  
  5.     http-equiv="content-type" content="text/html; charset=utf-8"/>
  6.     Google Maps JavaScript API Example
  7.     src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
  8.             type="text/javascript">
  9.     type="text/javascript">
  10.     //<![CDATA[
  11.  
  12.     var map = null;
  13.     var geocoder = null;
  14.  
  15. /*
  16.         var southWest = bounds.getSouthWest();
  17.         var northEast = bounds.getNorthEast();
  18.         var lngSpan = northEast.lng() - southWest.lng();
  19.         var latSpan = northEast.lat() - southWest.lat();
  20. */
  21.  
  22.         function showAddress(address) {
  23.                 if (geocoder) {
  24.                   geocoder.getLatLng(
  25.                     address,
  26.                     function(point) {
  27.                       if (!point) {
  28.                          alert(address + " not found");
  29.                       } else {
  30.                         map.setCenter(point, 13);
  31.                         var marker = new GMarker(point);
  32.                         map.addOverlay(marker);
  33.                         marker.openInfoWindowHtml(address);
  34.                         }
  35.                         }
  36.                         );
  37.                         }
  38.                 }
  39.     function load() {
  40.       if (GBrowserIsCompatible()) {
  41.         var map = new GMap2(document.getElementById("map"));
  42.         map.addControl(new GSmallMapControl());
  43.         map.addControl(new GMapTypeControl());
  44. //      map.setCenter(new GLatLng(52, 0), 6);
  45.         showAddress("San Francisco");
  46.         var geocoder = new GClientGeocoder();
  47.       }
  48.     }
  49.  
  50.     //]]>
  51.    
  52.  
  53.   onload="load()" onunload="GUnload()">
  54.  
  55.  

PermaLink to this entry https://pastebin.co.uk/11559
Posted by Anonymous Thu 8th Mar 2007 12:37 - Syntax is HTML (4.0.1) - 100 views
Download | New Post | Modify | Hide line numbers

 

Comments: 0