Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Give double value to Geopoint in GoogleMap overlays

I want to point to a Google map location using overlay. For this purpose latitude and longitude values will be assigned to a GeoPoint, but it only accepts int values.

How can I assign it a double value? Or is there another solution to point to an exact location?

point = new GeoPoint((int)t.getLati(),(int)t.getLongi()) 

Any help would be appreciated.

like image 441
UMAR-MOBITSOLUTIONS Avatar asked Feb 09 '10 08:02

UMAR-MOBITSOLUTIONS


1 Answers

Since GeoPoint accepts latitudes and longitudes in microdegrees, simply create your point like so:

GeoPoint point = new GeoPoint((int)(latitude * 1e6),
                              (int)(longitude * 1e6));
like image 187
Roman Nurik Avatar answered Nov 05 '22 11:11

Roman Nurik