| View previous topic :: View next topic |
| Author |
Message |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Wed Apr 12, 2006 12:08 am Post subject: GeoTracks/Tags... |
|
|
Hi Humpa,
on the dreaded night shift once again and I've been looking around the net as usual...I thought I posted a lot of questions, but after finding the 58 page thread on HoFo RE: Your MMS scripts, I don't feel so bad now
I've just been looking at your GeoTracks page and was wondering, when you have some spare time, if you'd be prepared to share a little information as to how you did it? I'm not after code or scripts or anything, just interested in the methods you used to do it.
Cheers  |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Wed Feb 13, 2008 8:19 pm Post subject: |
|
|
Hi Humpa,
how's it going? Very well I hope!
I've now got myself a new phone that has built-in GPS. I've been playing around with it for a couple of weeks and it's opened up a whole new arena for me. I'm becoming quite interested in Geotagging etc., but not too sure how to go about it all. I've played around with Google Maps and have uploaded kml files to it etc. I've got a simple page at the moment that will show one of my kml files using:
| Code: |
var kml = new GGeoXml("http://myurl.com/maps/mykml.kml");
map.addOverlay(kml); |
But I can't work out how to have a choice of kml files to show - kinda like you do on your Geotracks page.
Any pointers as to how I would achieve something like this?
Cheers for any advice  |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Wed Feb 13, 2008 8:52 pm Post subject: |
|
|
kml files used to be just for Google Earth, right?
I think I'll have to look into using kml files - that might be easier than using the Google Maps API the way I do now.
Using the Google Maps API is not something I could explain - I use the resources online to build my pages.
http://code.google.com/apis/maps/
I have nmea txt files with a list of coordinates (running my GPS on my pda, I had a GPS program save a log file of the GPS data in the standard nmea format), and I've added these txt files to a table in a database.
Then when you go to my page, it queries the database and builds the javascript code for the Google Maps API to use, complete with the markers and various contents for each marker.
And I believe a lot of my stuff is broke since Google has updated their API version since I wrote the code and that broke a lot of things. I basically have to write it all over again from scratch because looking at the code I have no idea how it works.
I have rewritten the code on thephonecam.com to fix one of our Google Maps pages:
http://www.thephonecam.com/geotag_pics_map.php
Look at the source code for that page and you can see that it is not something simple.
But I have another one I use so you can see the location of where all the different members are from - that one I haven't fixed yet.  |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Wed Feb 13, 2008 9:00 pm Post subject: |
|
|
But you can just use php to do what you want.
Create a page called map.php
Then pass the kml filename to the map.php file, and it will show that kml
| Code: |
<?php
$kml = $_GET['kml'];
$content = '
var kml = new GGeoXml("http://myurl.com/maps/'.$kml'");
map.addOverlay(kml);
';
echo $content;
?> |
Then to show the mykml.kml, just make your link to http:myurl.com/map.php?kml=mykml.kml |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Mon Feb 25, 2008 2:29 am Post subject: |
|
|
Humpa,
sorry for not posting up before - I should have done...
Thanks for the help on this - I've now got it all working (thanks to your help!).
Thanks a lot  |
|
| Back to top |
|
 |
|