如何在地图中“显示"路径 [英] How to 'display' paths in a map

查看:223
本文介绍了如何在地图中“显示"路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

谁能告诉我如何在交互式地图中显示"两点之间的路径?我的意思是,将使用Djisktra的算法采用两个用户选择的点之间的最短路径.但是我该如何在地图上实际显示它呢?

非常感谢您的帮助.

Hi all,

Can anyone please tell me how to ''display'' a path between two points in an interactive map? I mean, the shortest path between two user selected points will be taken using Djisktra''s algorithm. But how can I actually display it in the map?

Thank you very much for your help.

推荐答案

您好,您想让一种算法在两点之间找到最短的parth吗?或者您想绘制地图或其他内容?请说明您到底想要什么.

如果需要算法,请尝试 http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm [ ^ ]

而且,如果您有自己的算法,则需要存储不同的顶点(即地点,城市,州或国家/地区)和边缘及其权重(即两个不同地点之间的距离),然后可以将该算法应用于地图.

如果需要一些特定的信息,请进一步详细说明.
Hi do you want a algorithm to find shortest parth between two points? Or you want to draw in you map or something.? Please clarify what exactly you want.

If you want algorithm then try this http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm[^]

And If you have your algorithm then you need to store the different verticies (i mean places or city or state or country) and edges with their weight (i.e. distance between two different places) Then you can apply that algorithm to you map.

If want some specific info please elaborate it further.


这篇关于如何在地图中“显示"路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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