-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix vector drifts when
zoomAnimation
is false
and zooming via `fl…
…yTo` or pinch (#8794) Co-authored-by: Florian Bischof <design.falke@gmail.com>
- Loading branch information
1 parent
8887c41
commit af165dd
Showing
3 changed files
with
176 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Leaflet debug page</title> | ||
<link rel="stylesheet" href="../../dist/leaflet.css" /> | ||
<link rel="stylesheet" href="../css/screen.css" /> | ||
<script src="../../dist/leaflet-src.js"></script> | ||
</head> | ||
<body> | ||
<button id="btn-1">A</button> | ||
<button id="btn-2">B</button> | ||
<div id="map"></div> | ||
|
||
<script> | ||
var map = L.map('map', { | ||
zoomAnimation: false, | ||
// preferCanvas: true | ||
}).setView([0, 0], 7); | ||
|
||
var markerA = L.marker([1, 0]).addTo(map); | ||
var markerB = L.marker([1, 2]).addTo(map); | ||
L.polygon([ | ||
[0, 0], | ||
[2, 0], | ||
[2, 2], | ||
[0, 2], | ||
[0, 0], | ||
]) | ||
.bindPopup('Hello world') | ||
.addTo(map); | ||
|
||
// or pinch zoom in mobile | ||
document.getElementById('btn-1').addEventListener('click', function () { | ||
map.flyTo(markerA.getLatLng(), 6); | ||
}); | ||
document.getElementById('btn-2').addEventListener('click', function () { | ||
map.flyTo(markerB.getLatLng(), 7); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters