title: Migrating my HTML Google MAP API version 2 to version 3
body: <p>I will really appreciate help for this.</p>
  
  <p>My html v2 file with some temporary key works fine. I am getting locations from some XML, create different colors markers and add some URLs also from XML attributes in Info Window(not too much complicated). Now I need to migrate this to v3. I found some equivalents for functions from v2 but I didn't find for GDownloadUrl( for loading XML) and also GIcon(G_DEFAULT_ICON);  Can someone please look at both of my codes and tell me how to change to make this works also in v3. I changed most of the things so if someone can see some error I will be thankful. Thanks in advance. </p>
  
  <p>Version 2:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Google Maps&lt;/title&gt;
      &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=false&amp;amp;key=AIzaSyA4UDNP6MZ" type="text/javascript"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body onunload="GUenter code herenload()"&gt;
  
      &lt;!-- you can use tables or divs for the overall layout --&gt;
      &lt;table border=1&gt;
        &lt;tr&gt;
          &lt;td&gt;
             &lt;div id="map" style="width: 1250px; height: 1250px"&gt;&lt;/div&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
  
  
      &lt;script type="text/javascript"&gt;
      //&lt;![CDATA[
  
      if (GBrowserIsCompatible()) {
  
        var gmarkers = [];
  
        // A function to create the marker and set up the event window
        function createMarker(point,name,alarm,markerOptions) {
          var marker = new GMarker(point,markerOptions);
          GEvent.addListener(marker, "click", function() {
  
  
          var alarmanchor1='&lt;span class="url"&gt;&lt;a href="' + alarm;
          var alarmanchor2='" title="www" target="_blank"&gt;Event List&lt;/a&gt;&lt;/span&gt;';
          var alarmanchor=alarmanchor1+alarmanchor2;
  
  
          marker.openInfoWindowHtml(alarmanchor);
          });
  
          return marker;
        }
  
  
        // This function picks up the click and opens the corresponding info window
        function myclick(i) {
          GEvent.trigger(gmarkers[i], "click");
        }
  
  
        // create the map
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng( 41.932797,21.483765), 10);
  
  
        // Read the data from alarms33.xml
        GDownloadUrl("alarms33.xml", function(doc) {
          var xmlDoc = GXml.parse(doc);
          var markers = xmlDoc.documentElement.getElementsByTagName("marker");
  
          for (var i = 0; i &lt; markers.length; i++) {
            // obtain the attribues of each marker
            var lat = parseFloat(markers[i].getAttribute("lat"));
            var lng = parseFloat(markers[i].getAttribute("lng"));
            var point = new GLatLng(lat,lng);
            var alarm = markers[i].getAttribute("alarm");
            var label = markers[i].getAttribute("label");
  
  
  
  
          var severity = parseFloat(markers[i].getAttribute("severity"));
          var severityIcon = new GIcon(G_DEFAULT_ICON);
          var color;
          if (severity == 0) color = "66FF33";
          else if (severity == 1) color = "990099";
          else if (severity == 2) color = "00CCFF";
          else if (severity == 3) color = "FFFF00";
          else if (severity == 4) color = "FFCC00";
          else if (severity == 5) color = "FF3300";
          else color = "yellow";
  
          severityIcon.image = "http://www.googlemapsmarkers.com/v1/" + color;
          severityIcon.iconSize = new GSize(15, 30);
  
          markerOptions = { icon:severityIcon };
  
  
  
  
            // create the marker
            var marker = createMarker(point,label,alarm,markerOptions);
            map.addOverlay(marker);
          }
  
        });
      }
  
      else {
        alert("Sorry, the Google Maps API is not compatible with this browser");
      }
  
  
  
      //]]&gt;
      &lt;/script&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Version 3:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Google Maps&lt;/title&gt;
      &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=3&amp;amp;sensor=false&amp;amp;key=AIzaSyDsa1LyWOQ" type="text/javascript"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body onunload="initialize()"&gt;
  
      &lt;!-- you can use tables or divs for the overall layout --&gt;
      &lt;table border=1&gt;
        &lt;tr&gt;
          &lt;td&gt;
             &lt;div id="map" style="width: 1250px; height: 1250px"&gt;&lt;/div&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
  
  
  
  
  
  
      &lt;script type="text/javascript"&gt;
      //&lt;![CDATA[
  
  
        var gmarkers = [];
  
        // A function to create the marker and set up the event window
        function createMarker(point,name,alarm,markerOptions) {
          var marker = new google.maps.Marker(point,markerOptions);
          google.maps.event.addListener(marker, "click", function() {
  
  
          var alarmanchor1='&lt;span class="url"&gt;&lt;a href="' + alarm;
          var alarmanchor2='" title="www.skolaznanja.com" target="_blank"&gt;Event List&lt;/a&gt;&lt;/span&gt;';
          var alarmanchor=alarmanchor1+alarmanchor2;
  
  
  
          var infoWindow=new google.maps.InfoWindow();
          infoWindow.setContent(alarmanchor);
          infowindow.open(map,marker);
  
          });
  
          return marker;
        }
  
  
        // This function picks up the click and opens the corresponding info window
        function myclick(i) {
          google.maps.event.trigger(gmarkers[i], "click");
        }
  
  
        // create the map
  
        function initialize() {
        var mapDiv = document.getElementById("map");
        var map;
        var myLatlng = new google.maps.LatLng(41.932797,21.483765);
        var myOptions = {
         zoom:10,
        center:myLatlng,
        mapTypeId:google.maps.MapTypeId.ROADMAP
        };
        map = new google.maps.Map(mapDiv, myOptions);
  
       } 
  
        //var map = new google.maps.Map(document.getElementById("map"));
        //map.addControl(new GLargeMapControl());
        //map.addControl(new GMapTypeControl());
        //map.setCenter(new google.maps.LatLng( 41.932797,21.483765), 10);
  
  
        // Read the data from example.xml
        GDownloadUrl("alarms44.xml", function(doc) {
          var xmlDoc = GXml.parse(doc);
          var markers = xmlDoc.documentElement.getElementsByTagName("marker");
  
          for (var i = 0; i &lt; markers.length; i++) {
            // obtain the attribues of each marker
            var lat = parseFloat(markers[i].getAttribute("lat"));
            var lng = parseFloat(markers[i].getAttribute("lng"));
            var point = new google.maps.LatLng(lat,lng);
            var alarm = markers[i].getAttribute("alarm");
            var label = markers[i].getAttribute("label");
  
  
  
  
          var severity = parseFloat(markers[i].getAttribute("severity"));
          var severityIcon = new GIcon(G_DEFAULT_ICON);
          var color;
          if (severity == 0) color = "66FF33";
          else if (severity == 1) color = "990099";
          else if (severity == 2) color = "00CCFF";
          else if (severity == 3) color = "FFFF00";
          else if (severity == 4) color = "FFCC00";
          else if (severity == 5) color = "FF3300";
          else color = "yellow";
  
          severityIcon.image = "http://www.googlemapsmarkers.com/v1/" + color;
          severityIcon.iconSize = new GSize(15, 30);
  
          markerOptions = { icon:severityIcon };
  
  
  
  
            // create the marker
            var marker = createMarker(point,label,alarm,markerOptions);
            map.setMap(marker);
          }
  
        });
  
  
  
  
      //]]&gt;
      &lt;/script&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>