osmdroid 和 Android 应用程序的地理点是否不同?

发布于 2024-12-19 13:56:55 字数 550 浏览 2 评论 0原文

我正在为我的 Android 应用程序使用 OsmDroid。我设置了一个 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 有什么问题吗?

I am using OsmDroid for my Android application. I am setting a IGeoPoint as follows

IGeoPoint point2 = new IGeoPoint() {

        public int getLongitudeE6() {
            return 51475022;
        }

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

this took me to deep blue sea. Whereas when I use google.mapview and set geopoint in following way

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

it takes me to where I want

What's wrong with osmdroid?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡水深流 2024-12-26 13:56:55

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

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

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

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

Why are you trying to create a constructor for an Interface?

The Osmdroid GeoPoint is a class which implements this interface. You just need to instantiate a GeoPoint, like this:

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

Then pass this to your .animate()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文