Leaflet.EdgeBuffer icon indicating copy to clipboard operation
Leaflet.EdgeBuffer copied to clipboard

can this be made to work for geojson

Open spydmobile opened this issue 4 years ago • 1 comments

my overlay is a geojson acting as a fog of war, so when I pan/drag the map it shows the boundary where no geojson is loaded exposing my map before I am ready, I would like to know If I could get this buffering to happen with my geojson too. thanks to you for contributing to the leaflet community! Greatly appreciated!

spydmobile avatar Oct 04 '20 14:10 spydmobile

I used the following to set padding on the renderer which seems to have such an effect for GeoJSON

var paddedRenderer = L.svg({ padding: 0.8 });

var geo = L.geoJSON(states,{style:mapstyle, renderer: paddedRenderer});

See https://gis.stackexchange.com/questions/296982/leaflet-geojson-map-buffering for some more discussion, there is some potential performance impact as more data is rendered.

centic9 avatar Jan 26 '24 10:01 centic9