From c4e473ed899afbc0129f3581f21e3d5ace1879ae Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Wed, 25 Dec 2024 00:55:36 +0300 Subject: [PATCH] Wrap diary entry location coordinates --- app/assets/javascripts/diary_entry.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/diary_entry.js b/app/assets/javascripts/diary_entry.js index 625d43a522..bd5fd4dd62 100644 --- a/app/assets/javascripts/diary_entry.js +++ b/app/assets/javascripts/diary_entry.js @@ -2,8 +2,10 @@ $(document).ready(function () { var marker, map; function setLocation(e) { - $("#latitude").val(e.latlng.lat); - $("#longitude").val(e.latlng.lng); + const latlng = e.latlng.wrap(); + + $("#latitude").val(latlng.lat); + $("#longitude").val(latlng.lng); if (marker) { map.removeLayer(marker);