让用户在谷歌地图上画曲线? [英] Letting users draw curved lines on a google map?

查看:41
本文介绍了让用户在谷歌地图上画曲线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人有让用户绘制从 a 点到 b 点的曲线图的示例或来源?

Does anyone have any examples or source for letting users draw curved maps from point a to point b?

谢谢,亚历克斯

推荐答案

您可能需要在 google 地图上使用某种图层.我知道有一个云应用程序可以让你在谷歌地图上拼字游戏,但它使用 flash 嵌入谷歌地图 scribblemaps.com/....

you might have to use some sort of layer on top of google map. I know there's a cloud app that allows you to scrabble on a google map, but it uses flash to embed the google map scribblemaps.com/… i don't think it's possible to use two points to create a curve perhaps more than two points.

如果我正确理解你的应用,基于你的网站,你希望实现的目标是让用户开辟道路"?如果是这种情况,也许您可​​以创建一个表单,用户可以在其中提交他们展开"的试验"的 Lat Lng 坐标,然后使用 Polyline 绘制与此类似的曲线 谷歌地图绘制曲线.

If i understand your application correctly, based on your website, the goal that you wish to achieve is to let users to "blaze a trail"? If that is the case maybe you can create a form where the users can submit Lat Lng coordinates of the "trials" that they've "blazed," and then use Polyline to draw the curve line similar to this google map draw curved line.

但是,如果用户只是想知道如何从 a 点徒步到 b 点等,那么您可以使用 DirectionServiceDirectionRenderer,并设置 DirectionsTravelModea> 到 google.maps.DirectionsTravelMode.WALKING 并以这种方式在地图上呈现方向,以便用户知道如何使用地图上绘制的方向 + 实际方向说明徒步旅行.

However, if users just want to know how to hike from point a to point b and etc, then you can use DirectionService and DirectionRenderer, and set the DirectionsTravelMode to google.maps.DirectionsTravelMode.WALKING and render the direction on the map that way so the user would know how to hike a route with directions drawn on the map + actual direction instructions.

这篇关于让用户在谷歌地图上画曲线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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