How to draw polyline perpendicular to another polyline using Leaflet

你。 提交于 2019-12-25 08:22:36

问题


I've drawn a polygon and I want to draw a perpendicular line to this polygon. I found the computeOffset function of google maps api from here, but I'm using Leaflet. Is there an equivalent function in Leaflet?

Here is a screenshot of drawing the polyline.

I want to draw the perpendicular line that passes through the start point of the drawing polyline (the start point is marked with a marker on the screenshot). The expected result is like this.

Thank you.


回答1:


No, Leaflet has no equivalent.

You'll have to resort to a geodetic utility library for this kind of calculations. See cheap-ruler, geographiclib and Turf.js.



来源:https://stackoverflow.com/questions/42514896/how-to-draw-polyline-perpendicular-to-another-polyline-using-leaflet

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!