带有 ItemizedOverlay 和地图滚动的 MapView

发布于 2024-07-12 06:36:11 字数 478 浏览 1 评论 0原文

我在 Android 中的 MapView 上自定义 ItemizedOverlay 时遇到问题。

我所做的: ItemizedOverlay 类的非常简单的后代,仅包装我自己类型的项目并使用 ItemizedOverlay 来完成所有艰苦的工作。

有效方法:几乎所有内容 - 项目都正确绘制,我可以点击它们等。

问题:如果我通过地图本身在视图中拖动地图,我可以滚动它没有问题。 但是,如果我尝试开始将地图移动到叠加层中的某个项目上(例如“按项目拖动地图”),它不会移动。

这确实是个问题,因为如果我有“更多”的项目,则无法拖动地图(无需取消缩放并抓取项目外部的地图)。

即使我不处理 ItemizedOverlay 生成的任何事件(例如,在叠加层中注释掉 onTap() ),也会出现此问题。

任何意见,将不胜感激。

I have a problem with custom ItemizedOverlay on the MapView in Android.

What I've done: Very simple offspring of ItemizedOverlay class that only wraps my own type of items and uses ItemizedOverlay for all the hard work.

What works: Nearly everything - items are drawn properly, I can tap them etc.

The problem: If I drag the map in the view by the map itself, I can scroll it without a problems. But if I try to start moving the map over one of items from my overlay (eg. "dragging map by item"), it doesn't move.

This is really problem, because if I have "a bit more" items, there is no way to drag the map (without un-zooming and grabbing map outside items).

This problem occurs even if I don't handle any events generated by ItemizedOverlay (eg. with onTap() commented out in my overlay).

Any advice would be appreciated.

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

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

发布评论

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

评论(1

我乃一代侩神 2024-07-19 06:36:11

好的,我们解决了这个问题。

但我们找到的唯一解决方案是编写我们自己的“ItemizedOverlay”版本(不继承它)。 例如。 我们正在绘制自己的叠加层并处理“点击事件”。

OK, we solved this issue.

But only solution we found was writing our own version of "ItemizedOverlay" (without inheriting it). Eg. we're drawing our own overlay and we handle "tap events".

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