Hi, and welcome aboard :)

Take a look at
http://www.remi-grumeau.com/labs/iui/geolocalisation.php

It uses the HTML5 built-in geolocalisation method, supported on iPhone  
Safari and desktop Firefox (since 3.5.x afair)

function getPosition(position)
{
        // PROMPT THE LONGITUDE
        alert(position.coords.latitude, position.coords.longitude));
        alert(position.coords.latitude, position.coords.latitude);
}

function errorCallback()
{  alert('error');      }

function myPosition()
{
        // GET GEOLOCALISATION INFOS FROM THE BROWSER
        navigator.geolocation.getCurrentPosition(getPosition, errorCallback,  
{maximumAge:600000});
}
Remi

Le 26 déc. 09 à 16:36, tzenobite a écrit :

> hi
> i'm brand new of iphone programming, even if i was a hypercarder many
> years ago and now i got a little knowledge bout javascript
> so, now i'm playing with all this developer tools and i'm enjoying
> myself so much
>
> first, i'm trying dashcode tool to training myself with simple webapps
> i got a simple question (i hope so): i need to get the device's speed
> via gps
> i know today it's possible to get position data into webapps:
> http://developer.apple.com/mac/library/documentation/AppleApplications/Reference/WebKitDOMRef/Coordinates_idl/Classes/Coordinates/index.html
> there seems to be all i have to know about it, but i can't figure out
> how i will get the data in the webapp, or: i don't undertand what i
> have to write in my javascript to get iphone's speed using these
> classes
> simply i need the js code to get speed...
> anybody out there may help me?
> thanks!
>
> matteo (italia)
>
> --
>
> 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 
> .
>
>

--

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