【问题标题】:Are the geopoint different for osmdroid and Android application?osmdroid 和 Android 应用程序的地理点是否不同?
【发布时间】:2012-01-14 03:49:10
【问题描述】:

我将 OsmDroid 用于我的 Android 应用程序。我正在设置一个 IGeoPoint 如下

IGeoPoint point2 = new IGeoPoint() {

        public int getLongitudeE6() {
            return 51475022;
        }

        public int getLatitudeE6() {
            return -300322;
        }
    };  
mapController.animateTo(point2);

这把我带到了深蓝色的大海。而当我使用 google.mapview 并按以下方式设置地理点时

myMapController.animateTo(new GeoPoint((int) (51.475022 * 1E6),
            (int) (-0.300322 * 1E6)));

它带我去我想去的地方

osmdroid 怎么了?

【问题讨论】:

    标签: android dictionary geolocation osmdroid


    【解决方案1】:

    您为什么要尝试为接口创建构造函数?

    Osmdroid GeoPoint 是一个实现这个接口的类。您只需要实例化一个 GeoPoint,如下所示:

    GeoPoint gPt = new GeoPoint(51500000, -150000); // latitude, longitude
    

    然后将其传递给您的 .animate()

    【讨论】:

    • NickT 你指的是哪个 .animate()?
    • 好的,例如:mapController.animateTo(gpt, MapController.AnimationType.MIDDLEPEAKSPEED);
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多