Fix for Google Map embed

  1.         drupal_set_html_head('
  2.                 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key='.variable_get('google_map_api_key', '').'"
  3.                 type="text/javascript">
  4.                 </script>
  5.                 <script type="text/javascript">
  6.             //<![CDATA[
  7.  
  8.             function load() {
  9.               if (GBrowserIsCompatible()) {
  10.                 var map = new GMap2(document.getElementById("map"));
  11.                 map.setCenter(new GLatLng(-41.211722, 173.803711), 18);
  12.                 map.addControl(new GSmallMapControl());
  13.                 map.addControl(new GMapTypeControl());
  14.                 geocoder = new GClientGeocoder();
  15.                 address = "'.$node->address.', '.$node->town.'"
  16.                 title = "'.$node->title.'"
  17.                 phone = "Phone: '.$node->phone.'"
  18.                 if (geocoder) {
  19.                         geocoder.setBaseCountryCode("NZ");
  20.                         geocoder.getLatLng(
  21.                           address,
  22.                           function(point) {
  23.                             if (!point) {
  24.                               alert(address + " not found.");
  25.                             } else {
  26.                               map.setCenter(point, 16);
  27.                               var marker = new GMarker(point);
  28.                               map.addOverlay(marker);
  29.                                 GEvent.addListener(marker, "click", function() {
  30.                                                         marker.openInfoWindowHtml("<b>"+title + "</b><br />" + address + "<br />" + phone);
  31.                                                 });
  32.                               marker.openInfoWindowHtml("<b>"+title + "</b><br />" + address + "<br />" + phone);
  33.                             }
  34.                           }
  35.                         );
  36.                      }
  37.               }
  38.             }
  39.        
  40.             //]]>
  41.             </script>
  42.         ');
  43.        
  44.         drupal_add_js('
  45.      $(document).ready(function() {
  46.          load();
  47.      });
  48.      $(document).unload(function() {
  49.          GUnload();
  50.      });
  51.         ','inline','footer');

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.