Friday, July 20, 2007

Use a GPS with your iPhone

Here is a little trick to allow you to use a GPS feed with Google Maps on your iPhone.

The Google Maps app on the iPhone is similar to the Google Maps for Mobile. A while back I discovered that you would input a URL for a KML feed into Google Maps mobile so when I got my iPhone I gave it a try on there too AND IT WORKED!

Simply type in the URL for a KML feed into the search box on the Google Maps app on your iPhone.

So how do we get our current GPS cords into the iPhone? You use a separate device like the Motorola i415 that you can pick up at Walmart for ~ $30 and load up the mologogo.com application on it. The phone can then transmit your coordinates to a web server where you can generate a KML feed for your iPhone.

You can find sample scripts on how to build the KML feed here: http://mologogo.wikispaces.com/

Here is the feed for mine: http://gps.jasongarland.com/earth1.kml

Type it into the search box on your iPhone and you will see my current location. (Assuming I have the Mologogo app running)

NO STALKERS PLEASE! This means don't attempt to go to any of the locations on this map to try and find me. If you want to talk to me you can send me a message on this blog.

11 comments:

Unknown said...

Does the Motorola i415 phone need to be activated to get this solution to work?

Blogger said...

unlimited internet for the Boost Mobile phones is about $0.30 per day. Another option might be to install a GPS on a WRT54GL and install it in your car. Connect your iPhone to the WRT54GL and load up the KML feed from the WRT54GL. This eliminates the need for the Boost Mobile phone.

ozzy said...

Hi Jason, Excellent post!!!

I was wondering how you can set up a connection between a GPS and a WRT54GL and also create the kml feed ?

Blogger said...

The WRT54GL run Linux. There are ways to modify the WRT54GL to give it a USB or serial port for you to connect your GPS. Then you would need to write a script to turn the GPS data into a KML feed and deliver it from a webserver running on the Linksys router.

Dmitry Fink said...

Does it reload the kml feed automatically based on the interval settings, or do I need to type in the kml location in the search filed each time I need to know my position?

Chadster said...

Hi Jason,
I miraculously got all the way to the end- this has been an adventure from the beginning, starting with finding the data cable..
Anyway, I have my feed up and running, it's following the exact php example at: http://mologogo.wikispaces.com/KML. I can call the script at the command line and it outputs the kml, however google maps doesn't seem to like a .php url, in either the iPhone maps or just in a browser on my desktop. If I call the php url via a desktop browser, I get a kml attachment, but that seems to screw up maps. How did you do it? I'll send you url specifics separately if you would be willing to check out my setup..

thanks!
Chad.armstrong[at]geemail

Chadster said...

Hi, I got it working. Mologogo was doing something weird with the coordinates and I had to modify the php to clean it up. Another question though: can you use any of the entries for driving directions? When I click the arrow to go into a location and click Directions from here, the Start field is blank. I can't get the location marker to do anything useful..

thanks

Blogger said...

finik: You need to reload it manually. I tried to make it reload automatically with one of the option in the KML API but it didn't work on the iPhone. Once you do a search it will keep it in your search history and you can easily pull it up again.

Blogger said...

Chadster: I think I had to call the script a .kml file to make it work properly. I believe it also matters what you use for a Content-Type: header. Directions? Hmm.. I just tried it. I can't get it to work either. Maybe an app could be written that works like this one: http://gizmodo.com/gadgets/apple/iphone-gps-hack-works-and-is-awesome-301459.php


and push the cords into Google Maps on the iPhone. However that is beyond my skill.

Chadster said...

Haha- thanks Jason, I saw that Navizon P2P GPS development as well. Neat stuff! It works so-so for me, as far as coverage, but well-enough that I'll use Navizon primarily. $24.99 up front as opposed to 10 bucks a month for Boost.. The only thing about Navizon is that it doesn't publish your location as far as I can tell, it's only a request-your-location from your phone kind of thing. So no kml, which sucks, because I want to be able to give my location url to friends, which I guess is only available with real GPS. Oh well.

sbackl said...
This comment has been removed by a blog administrator.