Sorry, you must be logged in to use the shoutbox!

Author Topic: Been playing with Google maps -- Fixed --OK fixed for real this time :)  (Read 3037 times)

0 Members and 1 Guest are viewing this topic.

Offline BeerCan

  • Forum Moderator
  • Ninja Master Cyclist
  • *****
  • Posts: 891
  • Karma: +142/-34
  • Gender: Male
  • My Bike: Turner Sultan (V1)
Wow never realized how powerful google maps can be.  I started messing around with them in this post http://www.swampclub.org/smf/index.php/topic,1101.msg7124.html#msg7124  and saw some potential.  I wanted to know if I could overlay my gps data onto a google map.  Well low and behold you can.  Here is an example of some data I recorded last week at santos.  It is a KML file that I have overlayed on a google map.  I have included show / hide buttons so you can see what I mean  ;D  Try using the controls and zoom in on the vortex  :D
I turrned this into a link because something in my code id messing with the forum code in this thread.  Just open my link in a new tab for now.  You are using tabs right?  ;D  Ok I think I have the iframe issue figured out.  We will see  :-\

« Last Edit: July 01, 2007, 08:02:07 PM by BeerCan »
"Writing about music is like dancing about architecture." Frank Zappa
------------------------------------

Offline FACTORe

  • Yellow Jersey
  • *****
  • Posts: 4092
  • Karma: +25/-477
  • Gender: Male
  • team - independent self supported
Re: Been playing with Google maps
« Reply #1 on: June 30, 2007, 10:40:07 AM »
what is the code to insert a map?

Offline FACTORe

  • Yellow Jersey
  • *****
  • Posts: 4092
  • Karma: +25/-477
  • Gender: Male
  • team - independent self supported

Offline BeerCan

  • Forum Moderator
  • Ninja Master Cyclist
  • *****
  • Posts: 891
  • Karma: +142/-34
  • Gender: Male
  • My Bike: Turner Sultan (V1)
Re: Been playing with Google maps
« Reply #3 on: June 30, 2007, 05:17:45 PM »
First I created an html page on my server that contained the following
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAx7aec0lK_NMuNFGxo_RdlBQiBAje2zGKXQJYmoomJGnxTwue2xTEPNGsmzuoi5dHdz58Pgo4KCp0kA" type="text/javascript"></script>
  </head>
  <body onunload="GUnload()">


    <div id="map" style="width: 768px; height: 512px"></div>
        <br><input type="button" value="hide" onclick="map.removeOverlay(kml)">
        <input type="button" value="show" onclick="map.addOverlay(kml)">

    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
      However, it seems JavaScript is either disabled or not supported by your browser.
      To view Google Maps, enable JavaScript by changing your browser options, and then
      try again.
    </noscript>
 

    <script type="text/javascript">
    //<![CDATA[
   
    if (GBrowserIsCompatible()) {


 
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(29.095777, -82.094908), 15);
      map.setMapType(G_HYBRID_TYPE );
     
      // ==== Create a KML Overlay ====
   
      var kml = new GGeoXml("http://www.govbt.com/santos.kml");
      map.addOverlay(kml);


    }
   
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

   

    //]]>
    </script>
  </body>

</html>


Then I created a kml fike on my server that contained the following
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>santos.kml</name>
<Style id="lineStyle">
<LineStyle>
<color>64eeee17</color>
<width>6</width>
</LineStyle>
</Style>
<Placemark>
<name>Path</name>
<styleUrl>#lineStyle</styleUrl>
<LineString>
<tessellate>1</tessellate>
<coordinates>
-82.09555300000001,29.104976,32.341553 -82.09557,29.104715,32.822266 -82.09584200000001,29.104573,33.302856 -82.095742,29.104784,32.341553 -82.09563,29.104857,31.860718 -82.095917,29.104902,32.341553 -82.095719,29.104884,31.860718 -82.095404,29.10492,31.860718 -82.095102,29.104763,31.860718 -82.09498499999999,29.104462,31.860718 -82.094813,29.104171,31.860718 -82.09471500000001,29.103882,31.380127 -82.09468099999999,29.103562,30.899536 -82.094722,29.103258,30.418823 -82.09495699999999,29.102966,31.860718 -82.095152,29.102677,32.341553 -82.095421,29.10249,32.822266 -82.095675,29.102248,32.341553 -82.09585800000001,29.101948,30.418823 -82.095927,29.101761,29.45752 -82.09603,29.101554,28.976929 -82.095849,29.10141000000001,28.015503 -82.096144,29.101239,26.573608 -82.096322,29.101011,25.612305 -82.09617900000001,29.100761,26.092896 -82.09591,29.100749,26.573608 -82.09578999999999,29.100545,28.496216 -82.096064,29.100451,27.534912 -82.09634300000001,29.100656,26.573608 -82.09668499999999,29.100859,25.612305 -82.09691100000001,29.100739,26.573608 -82.096996,29.100425,27.534912 -82.097047,29.10008,27.534912 -82.096878,29.0998,27.054321 -82.096558,29.099602,27.054321 -82.09630900000001,29.098944,27.534912 -82.096058,29.09894600000001,28.496216 -82.09602900000002,29.09869,29.45752 -82.09596000000001,29.098384,29.45752 -82.09601000000001,29.09806,30.418823 -82.095962,29.097748,30.418823 -82.096149,29.097478,31.380127 -82.096329,29.097208,31.860718 -82.09670800000001,29.09714,32.341553 -82.097095,29.09721,31.860718 -82.097517,29.097198,29.93811 -82.09789499999999,29.097269,28.496216 -82.09787300000002,29.096932,29.93811 -82.097809,29.096667,31.380127 -82.097669,29.096462,32.341553 -82.097402,29.096316,31.860718 -82.097086,29.096186,32.341553 -82.09675100000001,29.09617,31.380127 -82.096459,29.096045,30.899536 -82.096441,29.095709,31.380127 -82.096576,29.095374,31.380127 -82.09645999999999,29.095045,30.899536 -82.09647699999999,29.094706,29.45752 -82.096531,29.094381,29.45752 -82.096752,29.094106,28.976929 -82.09697900000001,29.093874,28.976929 -82.09727900000002,29.093306,28.496216 -82.09751799999999,29.093284,28.496216 -82.09772,29.0932,28.496216 -82.09832299999999,29.093722,28.976929 -82.09871200000001,29.09375,28.976929 -82.09897599999999,29.093647,28.976929 -82.09928100000001,29.093469,28.976929 -82.09957900000001,29.093259,28.976929 -82.09984,29.093061,28.976929 -82.099885,29.092727,28.496216 -82.09946500000001,29.092902,28.496216 -82.099248,29.09306,28.976929 -82.09918500000001,29.092832,29.45752 -82.099424,29.09253,29.45752 -82.09972500000001,29.092358,29.45752 -82.099763,29.091993,29.45752 -82.09997400000002,29.091716,28.976929 -82.100279,29.091661,28.976929 -82.100454,29.09193000000001,28.976929 -82.10063599999999,29.092254,29.93811 -82.100998,29.092398,29.45752 -82.10117099999999,29.092654,28.976929 -82.10077000000001,29.092672,29.93811 -82.10042300000001,29.09283900000001,29.93811 -82.10011300000001,29.093025,29.93811 -82.099859,29.093255,30.418823 -82.099732,29.093547,29.45752 -82.09942200000002,29.09369,29.45752 -82.099198,29.09395,29.45752 -82.099036,29.094236,28.976929 -82.098837,29.093994,29.93811 -82.098382,29.093995,29.45752 -82.09805299999999,29.094067,29.93811 -82.09823,29.094278,29.93811 -82.098641,29.09427300000001,29.45752 -82.09883499999999,29.094447,28.976929 -82.099239,29.094441,30.418823 -82.0996,29.094359,29.93811 -82.099797,29.094077,28.976929 -82.09996700000001,29.093836,29.45752 -82.100055,29.094009,29.93811 -82.100387,29.094089,29.45752 -82.100718,29.093901,29.45752 -82.10108,29.093844,28.976929 -82.101407,29.093684,28.496216 -82.101766,29.09359200000001,28.976929 -82.101876,29.093249,29.45752 -82.101868,29.092931,29.93811 -82.10150899999999,29.092655,29.45752 -82.101524,29.092361,29.45752 -82.101829,29.092195,30.418823 -82.10201100000001,29.091941,30.418823 -82.10220700000001,29.091682,30.418823 -82.102761,29.09147,29.93811 -82.102761,29.091092,28.976929 -82.102363,29.090842,28.976929 -82.102761,29.090565,28.976929 -82.102761,29.090199,29.93811 -82.102761,29.089891,31.380127 -82.10289400000001,29.089629,31.860718 -82.103184,29.089675,32.822266 -82.103472,29.08972,31.380127 -82.103216,29.08968000000001,31.860718 -82.103083,29.08967,31.860718 -82.10350400000002,29.089726,31.380127 -82.103865,29.089737,31.860718 -82.104231,29.089737,32.341553 -82.104602,29.089737,31.860718 -82.104978,29.089663,31.380127 -82.105345,29.089599,30.418823 -82.10570199999999,29.08956600000001,30.418823 -82.10568000000001,29.089561,30.899536 -82.10548,29.089587,32.341553 -82.105293,29.089549,30.899536 -82.10563000000001,29.089591,30.418823 -82.106014,29.089499,31.380127 -82.10642,29.089477,31.380127 -82.106779,29.089526,30.899536 -82.107056,29.08967,30.899536 -82.10704700000001,29.089988,31.860718 -82.107018,29.090286,32.341553 -82.107027,29.090621,33.783447 -82.106702,29.090687,33.302856 -82.106588,29.090985,33.783447 -82.106966,29.090982,33.302856 -82.107151,29.091217,32.822266 -82.10716300000001,29.091534,31.380127 -82.107269,29.091855,29.45752 -82.107597,29.091958,28.496216 -82.107772,29.091773,28.976929 -82.107856,29.091625,28.976929 -82.10807300000001,29.091387,28.496216 -82.108316,29.091153,27.534912 -82.108462,29.091012,26.092896 -82.108239,29.091214,26.573608 -82.108007,29.091435,27.534912 -82.10782399999999,29.091698,27.534912 -82.107533,29.091822,28.015503 -82.10726099999999,29.091749,28.015503 -82.107265,29.091454,29.93811 -82.107293,29.091165,31.380127 -82.10717400000002,29.09087,33.783447 -82.10684000000001,29.09082400000001,33.783447 -82.10665299999999,29.090755,33.302856 -82.10663200000001,29.09107300000001,34.26416 -82.10658100000001,29.09138,34.744873 -82.106409,29.091665,32.341553 -82.106731,29.091632,34.26416 -82.10660000000001,29.091833,30.418823 -82.106764,29.091999,32.341553 -82.106532,29.092274,29.45752 -82.10688800000001,29.092439,30.418823 -82.106787,29.092273,34.26416 -82.106927,29.091991,32.341553 -82.107056,29.091774,32.822266 -82.106878,29.091503,34.744873 -82.106861,29.09122500000001,33.783447 -82.107151,29.091145,35.225464 -82.10709,29.091435,33.783447 -82.10713200000001,29.091739,32.822266 -82.10699099999999,29.092035,33.783447 -82.107213,29.092231,31.860718 -82.10753200000001,29.092285,29.93811 -82.107743,29.092349,31.860718 -82.10784099999999,29.092485,32.822266 -82.108147,29.092428,34.744873 -82.108386,29.092429,36.186768 -82.108508,29.092321,36.186768 -82.10859499999999,29.092128,35.225464 -82.108524,29.092071,34.744873 -82.108863,29.092088,37.148071 -82.10884900000001,29.091955,38.590088 -82.108682,29.09169500000001,34.744873 -82.108946,29.0916,39.070679 -82.108758,29.09176100000001,35.706055 -82.109054,29.09182300000001,38.109375 -82.109104,29.091544,37.628662 -82.109,29.091316,39.551269 -82.108689,29.09131,35.706055 -82.108762,29.091348,37.148071 -82.10909599999999,29.09118700000001,36.186768 -82.10941699999999,29.091117,36.667481 -82.10965500000002,29.09135,35.706055 -82.110039,29.091238,36.186768 -82.11039,29.091057,36.667481 -82.11055399999999,29.090752,35.225464 -82.11024800000001,29.090548,36.186768 -82.110107,29.09051,39.070679 -82.110383,29.09046,35.225464 -82.11017800000001,29.090306,37.148071 -82.109826,29.090334,34.744873 -82.10994599999999,29.090575,37.628662 -82.109782,29.090828,35.706055 -82.10982,29.091022,36.186768 -82.10955800000001,29.090825,36.667481 -82.10963200000001,29.090571,33.783447 -82.10945700000001,29.090441,31.860718 -82.109501,29.09019,34.26416 -82.109256,29.090014,35.225464 -82.10903,29.089751,35.225464 -82.10886499999999,29.090049,33.783447 -82.108852,29.09037100000001,33.302856 -82.108829,29.090683,33.302856 -82.108851,29.09078,30.418823 -82.10874200000001,29.090484,32.341553 -82.108676,29.090187,31.860718 -82.10863800000001,29.089859,32.822266 -82.10880800000001,29.089615,31.380127 -82.108863,29.089309,27.534912 -82.108994,29.089055,27.534912 -82.10899000000001,29.08894400000001,33.302856 -82.10916899999999,29.089203,33.302856 -82.109251,29.089517,34.744873 -82.10943400000001,29.089533,35.225464 -82.109348,29.089183,34.744873 -82.109111,29.088928,33.783447 -82.10883,29.08880200000001,31.860718 -82.108451,29.088732,30.418823 -82.10839900000001,29.088612,31.380127 -82.10867399999999,29.088634,30.418823 -82.108938,29.088722,32.822266 -82.10915,29.088872,31.860718 -82.109145,29.088684,30.899536 -82.108822,29.088469,31.380127 -82.10840400000001,29.088456,31.380127 -82.108257,29.088532,31.380127 -82.108278,29.08853300000001,31.380127 -82.108068,29.088449,30.899536 -82.10774600000002,29.088635,30.418823 -82.10763799999999,29.088873,30.899536 -82.10757200000001,29.089013,30.899536 -82.107597,29.089335,32.341553 -82.10739599999999,29.089522,31.380127 -82.107899,29.089599,31.860718 -82.108104,29.08962500000001,30.899536 -82.10811200000001,29.08978000000001,32.341553 -82.10832600000001,29.090031,28.976929 -82.108259,29.090241,28.015503 -82.108096,29.089976,29.45752 -82.10794900000001,29.089826,31.380127 -82.10781,29.089924,30.899536 -82.107485,29.089943,30.418823 -82.10733500000001,29.090064,31.860718 -82.107632,29.090239,32.822266 -82.10789200000001,29.09052,32.822266 -82.10783100000002,29.090825,34.744873 -82.10779100000001,29.090781,33.783447 -82.107731,29.090709,33.783447 -82.107759,29.09037,33.783447 -82.107547,29.090439,33.783447 -82.107427,29.090696,33.783447 -82.107325,29.090417,32.822266 -82.107315,29.09022,32.341553 -82.107111,29.09048200000001,32.822266 -82.107105,29.090233,31.860718 -82.107101,29.089899,31.860718 -82.107044,29.089587,31.380127 -82.10668700000001,29.089479,31.380127 -82.10634400000001,29.089506,31.380127 -82.105998,29.089538,30.899536 -82.105694,29.089567,30.899536 -82.105464,29.089588,31.860718 -82.10527500000001,29.089606,31.380127 -82.10495,29.089668,30.899536 -82.104607,29.089737,31.380127 -82.10424399999999,29.089737,31.380127 -82.10386800000001,29.089737,31.380127 -82.10351,29.089726,30.899536 -82.103149,29.089669,31.860718 -82.102828,29.089619,31.380127 -82.102761,29.089852,31.380127 -82.102761,29.090162,29.45752 -82.102761,29.090508,28.496216 -82.102761,29.090802,28.976929 -82.102761,29.09104,28.496216 -82.102761,29.091269,28.976929 -82.102761,29.091544,29.45752 -82.102238,29.09161,29.93811 -82.10191,29.091829,30.418823 -82.101722,29.092059,30.899536 -82.10136799999999,29.092245,30.418823 -82.10140800000001,29.092656,30.418823 -82.101732,29.092895,30.899536 -82.101786,29.093206,30.899536 -82.101761,29.093542,29.93811 -82.101293,29.093681,30.418823 -82.100916,29.09379,30.418823 -82.10055800000001,29.093923,30.418823 -82.1002,29.094056,30.899536 -82.100049,29.09375100000001,30.418823 -82.099761,29.094039,29.45752 -82.099586,29.094319,30.418823 -82.099182,29.094327,29.45752 -82.09883600000001,29.094234,29.93811 -82.09839200000002,29.094174,30.418823 -82.098072,29.094109,30.418823 -82.098406,29.094011,30.899536 -82.09877400000002,29.094084,31.380127 -82.099065,29.094288,31.380127 -82.09927999999999,29.093961,30.899536 -82.09953400000001,29.093653,30.418823 -82.099885,29.093517,31.860718 -82.100112,29.093221,31.380127 -82.100495,29.093013,31.380127 -82.10086800000001,29.092825,31.860718 -82.101203,29.092646,30.418823 -82.10075900000001,29.09227900000001,30.418823 -82.100516,29.091932,30.418823 -82.10031600000001,29.091625,29.93811 -82.09987800000002,29.091735,30.899536 -82.09969200000001,29.092052,30.899536 -82.099512,29.092351,30.899536 -82.099244,29.092622,30.899536 -82.099013,29.092878,31.860718 -82.09927500000001,29.093157,31.860718 -82.099569,29.092883,31.380127 -82.09980400000002,29.093012,31.860718 -82.099569,29.093238,30.899536 -82.09923600000001,29.093385,31.380127 -82.098885,29.093604,31.860718 -82.098485,29.093647,31.860718 -82.09812800000002,29.093719,31.380127 -82.097784,29.093636,31.860718 -82.097376,29.09330200000001,31.380127 -82.09701800000001,29.093314,31.380127 -82.096752,29.093988,30.899536 -82.096835,29.093987,31.380127 -82.097194,29.093773,31.380127 -82.09754700000001,29.09375800000001,30.899536 -82.09755,29.093959,31.860718 -82.097562,29.094306,31.380127 -82.097601,29.094591,31.380127 -82.097392,29.094381,28.496216 -82.097325,29.094397,29.93811 -82.097353,29.094209,33.783447 -82.097296,29.094085,33.783447 -82.097269,29.093935,35.225464 -82.097167,29.094115,32.341553 -82.09704600000002,29.094101,33.302856 -82.09693400000001,29.09425,31.860718 -82.096756,29.094405,33.302856 -82.09695200000002,29.094634,28.496216 -82.09682100000001,29.094999,31.380127 -82.09673800000002,29.095172,33.783447 -82.09683600000001,29.094904,34.744873 -82.096889,29.09461,34.744873 -82.096706,29.094621,35.706055 -82.096682,29.094709,35.225464 -82.096648,29.094974,35.706055 -82.09656200000001,29.095242,34.26416 -82.09674699999999,29.095527,30.418823 -82.09664400000001,29.095631,34.26416 -82.09653,29.095961,34.744873 -82.096904,29.095935,31.860718 -82.096998,29.096191,36.186768 -82.096963,29.096358,38.109375 -82.096717,29.096427,39.070679 -82.096518,29.096505,43.396606 -82.096223,29.09635700000001,37.628662 -82.095919,29.096462,36.667481 -82.095612,29.096499,36.186768 -82.09528500000002,29.096431,35.225464 -82.095026,29.096665,35.706055 -82.09536300000001,29.096804,36.667481 -82.095725,29.096752,36.667481 -82.095664,29.096912,37.628662 -82.09565600000002,29.097251,38.109375 -82.095528,29.097543,37.628662 -82.095454,29.097856,37.148071 -82.095208,29.098051,36.667481 -82.094987,29.098283,36.667481 -82.09480600000001,29.098602,36.667481 -82.094638,29.098877,36.186768 -82.095016,29.099061,35.706055 -82.09531800000002,29.099263,36.186768 -82.09546600000002,29.099534,35.706055 -82.09544600000001,29.09982,35.706055 -82.095375,29.100117,35.225464 -82.095478,29.100417,34.744873 -82.09539,29.100713,35.225464 -82.09545,29.101049,34.26416 -82.09536300000001,29.101332,36.186768 -82.095518,29.101662,37.148071 -82.095511,29.101986,39.070679 -82.09545900000001,29.102272,40.032105 -82.095167,29.102431,40.032105 -82.094951,29.10271,40.032105 -82.094752,29.103037,39.070679 -82.094555,29.103353,38.109375 -82.094602,29.103695,39.070679 -82.094723,29.104036,40.032105 -82.09492400000001,29.104334,40.993408 -82.095041,29.104664,40.512817 -82.095377,29.104891,40.032105 -82.0955,29.10493500000001,37.628662 </coordinates>
</LineString>
</Placemark>
</Document>
</kml>

Then I called the html code from within the post using the iframe tag and Voilą one map with gps data overlay (plus some on off buttons :) )
"Writing about music is like dancing about architecture." Frank Zappa
------------------------------------

Offline Kevin Bennett

  • Ninja Master Cyclist
  • ****
  • Posts: 637
  • Karma: +30/-77
  • Space Ghost
Re: Been playing with Google maps -- Fixed
« Reply #4 on: June 30, 2007, 07:45:31 PM »
Holy Crap!  You are way too smart.  I bet you watched a lot of Star Trek! ;D  That is pretty cool....and I can't even load a pic.
God is great, beer is good, people are crazy!

Offline FACTORe

  • Yellow Jersey
  • *****
  • Posts: 4092
  • Karma: +25/-477
  • Gender: Male
  • team - independent self supported
Re: Been playing with Google maps -- Fixed
« Reply #5 on: June 30, 2007, 08:02:55 PM »
with motionbased it gives me the kml file - i just need to figure out how to post that -

Offline EllsRider

  • Yellow Jersey
  • *****
  • Posts: 1221
  • Karma: +127/-27
  • Gender: Male
  • 813Racing
Re: Been playing with Google maps -- Fixed
« Reply #6 on: June 30, 2007, 09:20:57 PM »
Nice!!! Keep it coming. Now, can you tell me how much elevation change is on that Tuesday  night Buffalo Wild Wings ride ?  ;D
" Not this time, Lance"

Offline BeerCan

  • Forum Moderator
  • Ninja Master Cyclist
  • *****
  • Posts: 891
  • Karma: +142/-34
  • Gender: Male
  • My Bike: Turner Sultan (V1)
Re: Been playing with Google maps -- Fixed
« Reply #7 on: June 30, 2007, 11:51:53 PM »
Nice!!! Keep it coming. Now, can you tell me how much elevation change is on that Tuesday  night Buffalo Wild Wings ride ?  ;D

Ummm  . . . that ride is a net elevation loss  ;D
"Writing about music is like dancing about architecture." Frank Zappa
------------------------------------

 

Advertisement: