iPhone Location Browser with Latitude and Longitude
August 20th, 2008 by sI’ve been working on a native iPhone version of Metosphere for a while, but after talking to several people I’ve decided to go in a slightly different direction. I’m about to submit this to the AppStore, but I wanted to bounce it off a larger audience first.
I’ve run into several web developers who want to make cool webapps for the iPhone using its location information. Unfortunately, even though they’re killer web devs, there are several hurdles to overcome such as not having a Mac, needing to learn Objective C, obtaining a certificate, etc.
So I proposed we just create a generic, skeleton, native iPhone app that would access our websites using UIWebView and do all the heavy lifting on the web side. A generic browser with a URL bar at the top but providing CoreLocation information to the website. Essentially, like Safari but allowing the website access to location information.
This solved several of the issues we’d been thinking of:
- We don’t all have to pay the SDK fee and spend weeks/months learning it. Web developers can focus on web development.
- Each of us doesn’t have to go through the hassle of creating an app, getting it approved, and maintaining it over time. We can just share the generic browser/client.
- The App Store is just going to get more crowded, I’m already getting tired of installing apps and uninstalling them right away. A general location browser allows someone to quickly try out a site without having to find and download an app.
I’d like to see this project open-sourced, although there’s been a lot of confusion recently if that’s allowed with the current SDK agreement.
There are some folks working on similar concepts like PhoneGap and WebToNative, but I think there’s room for a completely simple solution like this.
Ideally, location information would be an option to expose within Safari, but I’m not convinced that will ever happen. There are serious privacy issues if something like that were built into Safari, and it’s definitely not for most people. But there’s a subset of folks out there that have a use for something like Metosphere. Kind of like the location info provided in Google Gears or the Skyhook Firefox extension.
I was hoping to provide Lat/Long information to websites through HTTP headers, but that’s not available in UIWebView, so webpages that want location information from the Metosphere browser will need to include a simple Javascript function.
Here’s a summary of how this works:
- Install Metosphere on your iPhone (hope it gets approved!)
- Create a webpage with a Javascript function called updateLocation that looks something like this:
<html><head>
<script language=”javascript”>
var latitude=0; //these will be set when the Metosphere browser calls updateLocation()
var longitude=0;function updateLocation(metoLat, metoLng){
latitude=metoLat;
longitude=metoLng;
document.getElementById(“message”).innerHTML = “Your latitude=”+latitude + ” and longitude=” + longitude;
//now do something cool with latitude and longitude set
}
</script></head>
<body>
<div id=”message”>Location not available</div>
</body>
</html> - Enter your webpage’s URL in Metosphere’s location bar and your page should have access to the latitude and longitude.


- Create a webpage/webapp that does something cool with this location information.
Anyway, that’s the current direction for this project. Some cool features to add down the road would be:
- integration with Yahoo’s FireEagle
- a setting to allow the browser to periodically update location info at set intervals
- the ability to create extensions like Firefox
Posted in Location, Mobile, iphone |
6 Comments »

August 20th, 2008 at 5:01 am
What a great concept!
It makes me think. I wonder how should “location” be best handled in browsers. Either there should be a common way in Javascript that looks out if there is any location info available (either from the Loki plugin or any other source), or we should use location databases like Fire Eagle, so that browsers need not be able to look for location but contact Fire Eagle… In fact I would prefer the last one, concentrating the Fire Eagle client, only
August 20th, 2008 at 11:02 pm
[...] bookmarks tagged browser iPhone Location Browser with Latitude and Longitud… saved by 4 others soniclover200999 bookmarked on 08/21/08 | [...]
August 21st, 2008 at 8:19 am
Seni
Thanks for the plug and checking out Phonegap. We have been busy thinking about a lot of the same issues you have faced as we are firstly web developers.
Another dev on the team has created an app called big5 – check the groups for a screen cast. I believe it does exactly what you want. It is still awaiting approval from the app store.
Good luck to you!
Rob E.
August 21st, 2008 at 8:19 pm
@Ádám: Yeah, it’ll be interesting to see how location in browsers eventually plays out. I like FireEagle a lot, but I wish I could get more friends to sign up for it.
@Rob: Thanks for the heads up. I’ll check it out!
February 26th, 2009 at 5:50 pm
My project has nothing to do with Objective-C, but as you rightly state, one has to “go there” in order to do anything creative on the iPhone. Notwithstanding, do check out the PhoneGap API (phonegap.com). Theirs is a similar, complementary approach to the problem you’ve identified.
March 16th, 2009 at 1:04 pm
[...] public links >> webpages iPhone Location Browser with Latitude and Longitude Saved by anniebutterfly on Sat 07-3-2009 Widlwood Crest, Pier 6600 Motel Saved by millanpl on Wed [...]