开发者

Give double value to Geopoint in GoogleMap overlays

开发者 https://www.devze.com 2022-12-19 19:51 出处:网络
I want to point to a Google map location usi开发者_JS百科ng overlay. For this purposelatitude and longitude values will be assigned to a GeoPoint, but it only accepts int values.

I want to point to a Google map location usi开发者_JS百科ng 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.


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

精彩评论

暂无评论...
验证码 换一张
取 消