绘图在地图上 [英] Drawing in map
本文介绍了绘图在地图上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
提前感谢
米兰
解决方案
使用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:
- using Javascript with some vector graphics available around (SVG and VML), google maps actually use this technology to do some graphic like routing etc. (link)
- HTML5 CANVAS element (with excanvas extension to get this work in IE), (link)
- simply by "fake" lines as a html small elements position very close to each other (link)
这篇关于绘图在地图上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文