One of the less heralded features of iPhone 3.0 OS is geolocation data
available inside Mobile Safari. This isn't actually a feature of 3.0 per se,
but rather part of the HTML 5 spec. So, next Wednesday when you update your
phone to 3.0, the following code sample should return your latitude and
longitude. This already works in the latest betas of Firefox 3.5:

<html>
<head>
<title>Geolocation Test Page</title>
<script>
if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
        document.write("Latitude: " + position.coords.latitude + "<br
/>Longitude: " + position.coords.longitude);
    });
} else {
  alert("Geolocation services are not supported by this browser.");
}

</script>
</head>
<body>
</body>
</html>


DH



On Sat, May 23, 2009 at 8:34 PM, Bess <[email protected]> wrote:

>
> You can't access native web services via web app within safari. Only
> iphone SDK native app can access geo Corelocation.
>
> On May 23, 8:14 am, "James O'Boston" <[email protected]> wrote:
> > there are no calls in 2.0 to permit webapps to know or report the
> > phone's location.
> >
> > On May 22, 12:59 pm, Klaus Hougesen <[email protected]> wrote:
> >
> > > Havent you read The sdk? You allready Can in 2.0 / 3.0 only adds
> > > geolocation ( getting place names)
> >
> > > On May 20, 4:23 pm, Janko <[email protected]> wrote:
> >
> > > > Hi, I used the search function of the group with no answer.
> > > > My question is: with the release of the Iphone OS 3.0 is it currently
> > > > possible to access the GPS infos?
> > > > Anyway if I call from my webapp the googlemaps application is it
> going
> > > > to show me my GPS position or just the maps.google? And from there
> may
> > > > I use any information back in my webapp?
> >
> > > > Thanks, I hope someone give me any hint, 'cause I really need the
> best
> > > > way to integrate some kind of geolocalization in my app.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to