When adding a polygon to a Leaflet map, the border is quite wide (dark blue in image below). For maps of a wide area, this often obscures finer details of the map underneath.
Is it possible to reduce the width of the border, while retaining the other default styling of the polygon?
Currently I am creating the polygon from GeoJSON using
var boundary = { "type": "Feature", "geometry": {"type":"Polygon","coordinates":[....]}};
var poly = L.geoJson(boundary);
map.addLayer(poly);
I am using Leaflet 0.7.3 (latest stable release). I'd be interested in solutions that change the style across all instances of leaflet maps, as well as ways to change it for a specific map.
Please read the Leaflet documentation, which specifies a weight option for paths, which you can specify as an option to L.geoJson.
var poly = L.geoJson(boundary, { weight: 1 });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With