From 131d04d7a357f3d1c7f77f8f4931a96caee04d53 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Sun, 2 May 2021 00:36:53 +0200 Subject: [PATCH] To get from Yokohama to San Francisco, keep going east. --- src/wolnelektury/static/js/book_text/references.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/wolnelektury/static/js/book_text/references.js b/src/wolnelektury/static/js/book_text/references.js index b75a4daf3..b9fc40f86 100644 --- a/src/wolnelektury/static/js/book_text/references.js +++ b/src/wolnelektury/static/js/book_text/references.js @@ -59,10 +59,18 @@ if (ref.location) { enable_map(); - marker.setLatLng(ref.location); + let newLoc = [ + ref.location[0], + ref.location[1] + Math.round( + (map.getCenter().lng - ref.location[1]) / 360 + ) * 360 + ]; + + marker.setLatLng(newLoc); marker.bindTooltip(ref.label).openTooltip(); map.addLayer(marker); - map.panTo(ref.location, { + + map.panTo(newLoc, { animate: true, duration: 1, }); -- 2.20.1