可点击折线谷歌地图API的Andr​​oid [英] Clickable Polylines Google Maps API Android

查看:149
本文介绍了可点击折线谷歌地图API的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想点击一个谷歌地图V2的Andr​​oid地图上的点。如果点击的点上相交的折线路径的一个点,然后显示折线。我没有看到在Android的折线任何记录可点击的事件。我试图扩展当前折线对象(标记为最终)

I would like to click a spot on a Google maps v2 android map. If the clicked point intersects a point on a polyline path, then display the polyline. I do not see any documented clickable events for polylines in android. I tried to extend the current Polyline object (marked final)

还有什么其他选择呢我?

What other options do I have?

推荐答案

注册<一个href="https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/GoogleMap.OnMapClickListener"相对=nofollow>的 OnMapClickListener 。确定给定的点击就在你行你自己。如果是这样,做什么是你想做的事在这种情况下。

Register an OnMapClickListener. Determine if a given click is on your line yourself. If it is, do whatever it was you wanted to do in this case.

这篇关于可点击折线谷歌地图API的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆