knutole
knutole

Reputation: 1787

Wrong Leaflet.js tiles position, snaps into place on drag

I'm having trouble with a Leaflet bug (?) - when adding a layer, the tiles are in wrong position, and will only snap back into place on first drag. See this animated gif.

The map.invalidateSize() does nothing. Any suggestions?

Upvotes: 1

Views: 1242

Answers (2)

Richard Maneuv
Richard Maneuv

Reputation: 53

I've run across the same or similar bug on Webkit. (Firefox seems okay.) I fixed it with this workaround. After it's rendered, call:

map.panBy([1, 0]);

Upvotes: 2

aorfevre
aorfevre

Reputation: 5064

I add some issue with ordering of maps when trying to add a map into a Modal

I managed to solved that with this command : L.Util.requestAnimFrame(map.invalidateSize, map, !1, map._container);

Upvotes: 3

Related Questions