Skip to content

Commit

Permalink
Fix map marker click scroll to top
Browse files Browse the repository at this point in the history
  • Loading branch information
triole committed Feb 14, 2024
1 parent 8a2e844 commit 140365b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/func.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ function len_minus_one(arr) {

function open_marker(id, coords, desc_length) {
coords = [coords[0] + (0.0007 * desc_length), coords[1]]
var off = $('#map').offset()
map.setView(coords, 9)
for (var i in markers) {
if (markers[i].id == id) {
window.scrollTo({
top: 0,
top: off.top - 150,
behavior: 'smooth',
})
markers[i].openPopup()
Expand Down

0 comments on commit 140365b

Please sign in to comment.