将标记与Mapbox GL中的多线线连接
我正在使用Mapbox GL开发Web应用程序,更具体地说,它对React的绑定,React Map-Gl
。
该应用程序的计划功能之一是添加标记并连接它们。
但是,我很难连接标记。
当我单击标记时,我想开始绘制线路,当我单击其他位置时,将断点添加到线路上,然后在单击另一个标记时完成行。
我可以用什么?
I'm developing a web application using Mapbox GL, more specifically, its binding for React, react-map-gl
.
One of the planned functionalities for the app is adding markers and connecting them.
However, I'm having trouble connecting markers.
I want to start drawing the line when I click on a marker, add a breakpoint to the line when I click elsewhere and finish the line when I click on another marker.
What can I use for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也在从事同样的工作,您可以使用deck.gl在地图上绘制线路,也可以使用Geojson。
I am also working on same, you can use deck.gl for plotting lines on map, or you can also use geoJson for the same.
我最终要做的是使用
Editablegeojsonlayer
以及标记的功能以及它们之间的连接,如下所示:What I ended up doing was using an
EditableGeoJsonLayer
with the features for both the markers and the connections between them as follows: