I try to style a LineString in a Mapbox Map through L.Geojson and all the style properties I could find are: fillColor, colour, weight, opacity. Does anyone know if there is something else? For example to add a border width, a colour to this border, dashed the line, etc. ?
Asked
Active
Viewed 6,057 times
1 Answers
3
- title
- description
- marker-size
- marker-symbol
- marker-color
- stroke
- stroke-opacity
- stroke-width
- fill
- fill-opacity
Mapbox.js uses the simplestyle spec. That's where you can find out more about defaults and accepted values.
Adding a dashed line is a little more complicated, see dashArray in the leaflet documentation which will work with mapbox.js.
alidman
- 108
- 3
-
Thanks for your answer. In my case of a LineString (or PolyLine for leaflet) loaded with L.geojson, the correct answer is the Class Path. – Inclanfunk Mar 22 '14 at 13:02
-
1So how exactly can one add a border to a line string in Leaflet? Can you provide an example? – araichev May 02 '14 at 03:29
-
@araichev I don't know if you've figured out how to do that or not, but the way we are hacking it is to draw the GeoJSON once with an opaque background two pixels wider than the path, and then again with a semi-opaque background of our set color. Hacky, but it works. – Jonathan E. Landrum Aug 25 '15 at 19:09