fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0cb3321
)
To get from Yokohama to San Francisco, keep going east.
author
Radek Czajka
<rczajka@rczajka.pl>
Sat, 1 May 2021 22:36:53 +0000
(
00:36
+0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Sat, 1 May 2021 22:36:53 +0000
(
00:36
+0200)
src/wolnelektury/static/js/book_text/references.js
patch
|
blob
|
history
diff --git
a/src/wolnelektury/static/js/book_text/references.js
b/src/wolnelektury/static/js/book_text/references.js
index
b75a4da
..
b9fc40f
100644
(file)
--- 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();
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);
marker.bindTooltip(ref.label).openTooltip();
map.addLayer(marker);
- map.panTo(ref.location, {
+
+ map.panTo(newLoc, {
animate: true,
duration: 1,
});
animate: true,
duration: 1,
});