Give double value to Geopoint in GoogleMap overlays

后端 未结 1 1755
青春惊慌失措
青春惊慌失措 2020-12-14 08:31

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.

1条回答
  •  无人及你
    2020-12-14 08:55

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

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

    0 讨论(0)
提交回复
热议问题