android – Give double value to Geopoint in GoogleMap overlays-ThrowExceptions

Exception or error:

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.

How to solve:

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

GeoPoint point = new GeoPoint((int)(latitude * 1e6),
                              (int)(longitude * 1e6));

Leave a Reply

Your email address will not be published. Required fields are marked *