OpenWetWare:Software/Google Earth API

From OpenWetWare
Revision as of 15:16, 2 October 2007 by Reshma P. Shetty (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Google Maps API

This Google service could support in many ways the OWW community:

  • visualize locations of the OWW users
  • display all the Institutions involved
  • find the nearest outreach officers


Google Maps API Registration

OWW key is:

ABQIAAAALLbK9zjbd7JpTrkV4-YbwxRSXllrirTOP8BJPCtxjWVzsNMbFRQmkCSOpE5ARgUVPuqz3vsD2xHp3g

This key is good for all URLs in this directory:

http://www.openwetware.org/

Here is a map based on a KML file of all the OpenWetWare institutions in the OpenWetWare:World tour:

(The KML file is stored in Reshma's web directory because it doesn't seem to recognize the uploaded OWW version or the wiki page version ... something to do with the mime type perhaps.)

Ideally the KML file should live on an OWW page.

Here is an implementation of the map in javascript: demo

Here is an implementation of the map using wibbit: demo

<html xmlns="http://www.w3.org/1999/xhtml">

   <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAALLbK9zjbd7JpTrkV4-YbwxRSXllrirTOP8BJPCtxjWVzsNMbFRQmkCSOpE5ARgUVPuqz3vsD2xHp3g"
     type="text/javascript"></script>
   <script type="text/javascript">
   //<![CDATA[
   function load() {
     if (GBrowserIsCompatible()) {
       var map;
       var geoXml = new GGeoXml("http://web.mit.edu/~rshetty/Public/OpenWetWare.kml");
       map = new GMap2(document.getElementById("map")); 
       map.addControl(new GLargeMapControl());
       map.setCenter(new GLatLng(30,10), 2); 
       map.addControl(new GLargeMapControl());
       map.addControl(new GMapTypeControl());
       map.addOverlay(geoXml);
     }
   }
   //]]>

addOnloadHook(load); hookEvent("unload", GUnload);

   </script>
   <div id="map" style="width: 800px; height: 600px"></div>

</html>

Check out the API documentation for more information.