带有 ItemizedOverlay 和地图滚动的 MapView
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我们解决了这个问题。
但我们找到的唯一解决方案是编写我们自己的“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".