I am wondering if you are able to use simple markers in a dasharray for a polyline in Leaflet, like you can in QGIS. So instead of the simple dash I would like to have a hexagon as the dash. I have a polyline representing a stone wall and would like to symbolize it in my Leaflet map as shown in the following screenshot (from QGIS). Am I able to do this: Example from QGIS
Asked
Active
Viewed 279 times
0
-
[leaflet polylinedecorator](https://github.com/bbecquet/Leaflet.PolylineDecorator) – Seth Lutske May 04 '21 at 22:25
-
Hi Seth, I saw that plugin and noticed at the bottom of the Github page it mentions there may be an impact on performance since it creates an actual L.Layer object to draw the pattern symbols. I want the application to be as light-weight as possible so is there a way to do this by using the dashArray property of L.Path? – floyd434 May 05 '21 at 18:54
-
Well, no. The dashArray makes use of the [dash option in an svg](https://www.w3schools.com/graphics/svg_stroking.asp), which is nice and lightweight. What you are asking is to do is more complicated than a simple svg stroke. I'd try that plugin and see what it actually creates. Does it create a single layer that contains all your shapes as a single svg? Or does it create a new layer for every single hexagon? I'd hope it does the former, which will not be too bad for performance. If it does the latter, you can try applying `preferCanvas` on the map options, and that may force... – Seth Lutske May 05 '21 at 19:04
-
the plugin to draw all its layers as a canvas, which is better for performance. It may *not* force that, but without digging into the src code for that plugin, I can't tell you. If its an issue, you'll have to write your own code to draw these layers as an svg, but I think you can leverage the decorator plugin. poke around, try stuff out. – Seth Lutske May 05 '21 at 19:05