
// load the google map

function initialize() 
 { 
   if (GBrowserIsCompatible()) 
    { var map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(45.40954, 11.893349), 14);
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setMapType(G_HYBRID_MAP);
      map.enableDoubleClickZoom();
      // map.enableScrollWheelZoom();

      // bind a search control to the map, suppress result list
      // map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));

      // create a base icon for all the markers that specifies the shadow, icon dimensions, etc.
      var baseIcon = new GIcon(G_DEFAULT_ICON);
      baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
      baseIcon.iconSize = new GSize(20, 34);
      baseIcon.shadowSize = new GSize(37, 34);
      baseIcon.iconAnchor = new GPoint(9, 34);
      baseIcon.infoWindowAnchor = new GPoint(9, 2);

      // creates a marker whose info window displays the letter corresponding to the given index.
      function createMarker(point, index, text) 
       { // create a lettered icon for this point using our icon class
         var letter = String.fromCharCode("A".charCodeAt(0) + index);
         var letteredIcon = new GIcon(baseIcon);
         letteredIcon.image = "http://www.google.com/mapfiles/marker" + letter + ".png";

         // set up our GMarkerOptions object
         markerOptions = { icon:letteredIcon };
         var marker = new GMarker(point, markerOptions);

         GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(text); });

         return marker;
       }

      // add DEI marker
      var latlng = new GLatLng(45.40954, 11.893349);
      var text = " <b> DEI </b><br> Department of Information Engineering <br> University of Padua <br><br> Via Giovanni Gradenigo, 6 <br> 35131 Padua, Italy ";
      map.addOverlay(createMarker(latlng, 0, text));

      // add train station marker
      var latlng = new GLatLng(45.417292, 11.879894);
      var text = " <b> Train Station </b><br><br> Piazzale della Stazione, 1 <br> 35131 Padua, Italy";
      map.addOverlay(createMarker(latlng, 1, text));

      // add palazzo BO' marker
      var latlng = new GLatLng(45.406671, 11.876878);
      var text = " <b> Palazzo Bo' </b><br> University of Padua <br><br> Via 8 Febbraio 1848, 2 <br> 35131 Padua, Italy";
      map.addOverlay(createMarker(latlng, 2, text));


    }

 }

