Wasn't it Barry Hunter who wrote:
>

>------------------
>        lonSign = lonSign = 1
>
>         if(aLatLon[2]=="S"){
>                 latSign=-1;
>         }
>         if(aLatLon[5]=="W"){
>                 lonSign=-1;
>        }
>
>  var lat=latSign*(aLatLon[0]+(aLatLon[1]/60))
>  var lon=lonSign*(aLatLon[3]+(aLatLon[4]/60))
>
>...
>  map.setCenter(new GLatLng(parseFloat(lat), parseFloat(lon),true),5);
>------------------
>
>is how I would do it..

but aLatLon[0] is a String, so that forces the "+" to be considered to
be string concatenation rather than addition, and produces the wrong
result.

For example:
   javascript:alert( -1 * ("35" +("27"/60)))
outputs -350.45 instead of 35.45.

-- 
Mike Williams
http://econym.org.uk/gmap



--~--~---------~--~----~------------~-------~--~----~
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