Convert Long Lat to Double

0 views
Skip to first unread message

Uni...@gmail.com

unread,
Mar 10, 2009, 3:28:07 PM3/10/09
to iphone-map-view
Hi group,

I dont think this is an actual iphone-map-view issue but im not sure
where to look so i apologize in advanced if this is off topic.

The setCenterWithLatLng method accepts a GLatLng variable, and the
GLatLng is defined as
typedef struct {
double lat;
double lng;
} GLatLng;

Using Google Earth, I have found some locations that I want to visit
using MapView. but the locations in Google Earth are displayed like:
51°30'0.55"N
0° 7'34.45"W

How can i convert that into a GLatLng acceptable format?

Ive heard its something like
double lat = 51.0f+(30.0f/60.0f)+(0.55f/3600.0f);
double lng = 0.0f+(7.0f/60.0f)+(34.45f/3600.0f);

but that those coordinates are off by around 25 miles

Thanks

Uni...@gmail.com

unread,
Mar 11, 2009, 10:22:53 AM3/11/09
to iphone-map-view
After some research I found out I can get a GLatLng from google maps.
Which will do just nicely.
Reply all
Reply to author
Forward
0 new messages