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

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

 

Comments: 0