如何在地图视图上创建气球叠加层?
我需要从用户长按 MapView 的位置创建一个气球叠加层。
首先,我如何在选择点的地方动态创建气球覆盖?
用户将长按应用程序中的 MapView,手势检测器会捕获该手势。
我不知道如何在选定的点创建气球覆盖。有什么想法吗?
mGestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
@Override
public void onLongPress(MotionEvent e) {
Log.d(tag, "Long Press event");
// i need to create a balloon at the point that was long pressed
}
}
我称这是在地图上设置的叠加层中
mGestureDetector.onTouchEvent(ev);
I need to create a balloon overlay from where a user long presses on the MapView.
Firstly how would i create the balloon overlay dynamically where the point was selected?
A user will long press on the MapView within the application and the gesture detector cathches the gesture.
I dont know how to go about creating a balloon overlay at the point that was selected. any ideas?
mGestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
@Override
public void onLongPress(MotionEvent e) {
Log.d(tag, "Long Press event");
// i need to create a balloon at the point that was long pressed
}
}
i call this is in an overlay set on the map
mGestureDetector.onTouchEvent(ev);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了在地图上显示气球,通常您需要在地图上显示图钉。单击该图钉后,将会出现一个气球。这是如何执行此操作的示例。
https://github.com/jgilfelt/android-mapviewballoons
For showing ballon on map usually you need to show pins on your map. On clicking that pin a ballon will appear. here is an example of how to do it.
https://github.com/jgilfelt/android-mapviewballoons