This is what i do :

function dec2dms(deg)
{
    var results = new Array();

    results['d'] = Math.floor(deg);
    var remainder = deg - (results['d'] * 1.0);
    var gpsmin = remainder * 60.0;
    results['m'] = roundNearest(gpsmin, -1000)
    //results['m'] = Math.floor(gpsmin);
    //var remainder2 = gpsmin - (parseInt(gpsmin)*1.0);
    //results['s'] = Math.floor(remainder2*60.0);
    return results;
}

function roundNearest(num, acc){
    if ( acc < 0 ) {
        num *= acc;
        num = Math.round(num);
        num /= acc;
        return num;
    } else {
        num /= acc;
        num = Math.round(num);
        num *= acc;
        return num;
    }
}

On May 13, 11:16 pm, mapperzUK <[email protected]> wrote:
> rcheli.dk
> try:http://www.nearby.org.uk/coord.cgi?p=55.607972085381476+,11.765348911...
>
> if you need to do many sign up for an api 
> keyhttp://www.nearby.org.uk/api/convert-help.php
>
> Mapperzhttp://mapperz.blogspot.com/
>
> On May 13, 7:13 pm, "rcheli.dk" <[email protected]> wrote:
>
> > Okay, to be honest I am not all that good with the GPS devices, I have
> > a Garmin on my Nokia and my Garmin uses this format when I enter a
> > position manually N 55 36.478 E 11 45.921 is this not the format all
> > GPS devices uses when you enter a position manually?
>
> > But anyway, I need to convert this 55.607972085381476,
> > 11.7653489112854 to this N 55 36.478 E 11 45.921 fairly simple
> > procedure, I hope :)
>
> > Thanks
>
> > On May 13, 2:46 pm, "[email protected]" <[email protected]>
> > wrote:
>
> > > On May 13, 5:29 am, "rcheli.dk" <[email protected]> wrote:
>
> > > > I have been trying to convert lat lon, some google map positions, to
> > > > GPS coordinate i can use on my GPS device, but how do i convert the
> > > > lat lon to GPS format in code, i would like to write it as text on the
> > > > pushpin text on the map ??
>
> > > You are going to have to be a little clearer.  How is lat lon
> > > different from GPS format?
> > > The Google Maps API uses decimal latitudes and longitudes.  Most GPS
> > > devices can be set up to display decimal latitudes and longitudes.
>
> > >   -- Larry
>
> > > > I am using PHP if there are any PHP to do the calculation that would
> > > > be nice.
>
> > > > I have been searching but i can find any solution that i can
> > > > understand :)
>
> > > > the site ishttp://usmap.rcheli.dk
>
> > > > Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to