Difference between revisions of "Using GPS Data with Google Maps"

From Pvdwiki
Jump to: navigation, search
(Sample Code)
(Sample Code)
Line 7: Line 7:
  
 
===Sample Code===
 
===Sample Code===
<nohtml>
+
 
 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
 
   <head>
 
   <head>
Line 40: Line 40:
 
   </body>
 
   </body>
 
</html>
 
</html>
</nohtml>
 
  
 
===Why Google Maps is better than Google Earth===
 
===Why Google Maps is better than Google Earth===

Revision as of 23:23, 26 October 2006

Google maps is probably one of the most powerful features within google.

The API

The google API has specific instructions for adding maps, including GPS tracks to your website.

http://www.google.com/apis/maps/

Sample Code

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">

 <head>
   <title>Google Map Tracks</title>
   <style type="text/css">
   </style>
  <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAsNp9xgRS4yu00Rvm7mlCSRTn6FS1Bcq0FYDY5Ie8KnpnQlairxQRMrscabIS32xzU5Rop67ndJliZQ" type="text/javascript"></script>
  <script type="text/javascript">
   function onLoad() {
     var map = new GMap2(document.getElementById("map"),{mapTypes:[G_SATELLITE_MAP,G_NORMAL_MAP]});
     map.setCenter(new GLatLng(37.927895,-122.5702025), 15, G_SATELLITE_MAP);

map.addControl(new GSmallZoomControl(),new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(1, 1))); map.addControl(new GMapTypeControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(1, 1))); map.addControl(new GScaleControl(),new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(25, 5)))

var polyline = new GPolyline([ new GLatLng(37.929631,-122.570308), new GLatLng(37.929627,-122.570309), new GLatLng(37.929625,-122.570321), new GLatLng(37.929624,-122.570317), new GLatLng(37.929629,-122.570315), new GLatLng(37.929627,-122.570302), new GLatLng(37.929586,-122.57035), new GLatLng(37.929503,-122.570425)], "#0000FF", 5, 1); map.addOverlay(polyline); }

</script>
 </head>
 <BODY onLoad="onLoad()" onunload="GUnload()">
 </body>

</html>

Why Google Maps is better than Google Earth