绘图在地图上 [英] Drawing in map

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

问题描述

我想在地图中定义一些点,并希望通过点击它们加入2点。基本上,功能是识别地图中的位置,并通过单行连接。由于某些原因,我无法使用google map API,并希望使用JavaScript来实现。



提前感谢
米兰

解决方案

使用HTML本身不能产生两点之间的一条线(任意角度)。但是这可以通过以下方式实现:




  • 使用可用的矢量图形(SVG和VML)的Javascript,谷歌地图实际上使用这种技术一些图形,如路由等。(link)

  • HTML5 CANVAS元素(在IE中可以使用excanvas扩展名),(link)

  • 只是通过假行作为一个html小元素位置非常接近彼此


I would like to have some points defined in the map and would like to join the 2 points by clicking on them. Basically, the functionality is to identify the locations in the map and connect them by a single line. For some reason, I am not able to use google map API and would like to achieve this using JavaScript.

Thanks in advance, Milan

解决方案

Javascript with use of HTML itself cannot produce a line (in any angle) between two points . But this is possible by:

这篇关于绘图在地图上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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