topical media & game development

talk show tell print

mashup-flickr-13-Step-5-lib-js-map.js / js



  function doMap()
  {
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(0, 0), 1);
  
      GDownloadUrl(<geo.php>, function(data, responseCode) 
        {            
           var xml = GXml.parse(data);
           var photos = xml.documentElement.getElementsByTagName("photo");
           
           var s = "";
           var n = Math.min(photos.length, 5);
           for (var i = 0; i < n; i++) 
           {
              s += photos[i].getAttribute("id") + ", ";
           }
           
           alert("Ids received:\n\n" + s);
        });
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.