如何在谷歌地图中添加文本上述折线? [英] How to add text above polyline in google maps?

查看:209
本文介绍了如何在谷歌地图中添加文本上述折线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个指标,我想提请它们之间的线,并有显示线之上的距离的文本,就像在谷歌地图网页版。

I have 2 markers, I would like to draw a line between them, and have a text showing the distance above the line, just like in the web version of google maps.

我已经找到<一href="https://github.com/googlemaps/android-maps-utils/blob/master/demo/src/com/google/maps/android/utils/demo/DistanceDemoActivity.java"相对=nofollow>这一下拉2个标记之间的线,但我怎么添加上面的一行文字?样品

推荐答案

一个想法是利用自己的经纬度和坐标长来计算两个标记之间的中点,然后把与任何信息,你要显示的信息窗口。或者像下面这样可以帮助:的 链接

One idea would be to calculate the midpoint between the two markers using their lat and long coordinates and then put an infowindow with whatever information you want to show. Or something like the following could help: Link

这篇关于如何在谷歌地图中添加文本上述折线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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