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 »







