0
votes

I have a leaflet map with a few layers on it. Whenever layers are not in the viewport, they are hidden untill panning has completed:

Regular view with layers:

Regular view

Panning right, to show layers outside viewport:

Panning

Panning stopped:

Panning stopped

As illustrated above, the layers will first become visible once panning has stopped and mouse(finger) released.

I have tried the following, which didn't work

var map = L.map('map',{ bounceAtZoomLimits: false, removeOutsideVisibleBounds: false}).setView([40, 0], 2);
L.geoJson(mapData).addTo(map);
1

1 Answers

1
votes

Seems the solution was right in front of me

Adding the following will render the entire map:

var map = new L.Map('map');
map.getRenderer(map).options.padding = 100;

Solution found here