I've got a html file with a bit of javascript in it which asks for some GPS coordinates and converts them into standard latitude/longitude, and then opens up googlemaps with the coordinates to show you where it is. This works fine from the iphone, but it'd be a lot tidier if I could get it to feed the results to the built-in Maps application instead of the googlemaps website. Any idea how I could do this from within an html file?
I'm not sure why the GPS uses some sort of different measurement, but it does, and it's a pain. This is so I can take the response from a GPS tracking unit in a car and immediately find out where it is if it goes "missing".
In case anyone is interested, here's the code - I know it's probably not very efficient, and it's ugly, but it does what I need. You can easily take the "conversion" part out of it to get a quick Googlemaps lat/long launcher.
<html lang="en"><head><title>GPS to Google Maps Converter Thing</title>
<script type="text/javascript">
function google_maps_url() {
var div = document.getElementById('url');
var lon = document.getElementById('longitude').value;
var lat = document.getElementById('latitude').value;
var map_lat =((lat/100-lat%100/100) + Math.round(((lat % 100) / 60)*1000000)/1000000);
var map_lon =((lon/100-lon%100/100) + Math.round(((lon % 100) / 60)*1000000)/1000000);
div.innerHTML = "<a href=\"http://maps.google.co.nz/?f=q&geocode=&q="+ map_lat +","+ map_lon +"&z=19\">Latitude: "+ map_lat +", Longitude: "+ map_lon +"</a>";
return false;
}
</script></head><body>
<form id="map" action="" method="post">
GPS Latitude: <input name="latitude" id="latitude" value="-4111.123456" type="text"><br>
GPS Longitude: <input name="longitude" id="longitude" value="17446.456789" type="text"><br>
<input name="commit" value="Convert" onclick="return google_maps_url(this);" type="button">
</form><div id="url"></div></body></html>