给双重价值的GoogleMap覆盖到的GeoPoint [英] Give double value to Geopoint in GoogleMap overlays

查看:128
本文介绍了给双重价值的GoogleMap覆盖到的GeoPoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想指出,使用复用一个谷歌地图上的位置。为此目的,纬度和经度值将被分配给一个的GeoPoint,但它仅接受的int值

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()) 

任何帮助将是AP preciated。

Any help would be appreciated.

推荐答案

由于<一href="http://$c$c.google.com/android/add-ons/google-apis/reference/com/google/android/maps/GeoPoint.html">GeoPoint接受经度和纬度在microdegrees,只需创建你的观点,像这样:

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

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

这篇关于给双重价值的GoogleMap覆盖到的GeoPoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆