Skip to content

Commit

Permalink
viewer: update opened marker before setting view center on hash update
Browse files Browse the repository at this point in the history
Setting the marker may override the view center, so we update the view
center last.
  • Loading branch information
neocturne committed Jan 7, 2024
1 parent 710420a commit 900e796
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions viewer/MinedMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,11 @@ window.createMap = function () {

updateParams();

map.setView([-params.z, params.x], params.zoom);

if (params.light)
map.addLayer(lightLayer);
else
map.removeLayer(lightLayer);

if (features.signs) {
if (params.signs)
map.addLayer(signLayer);
Expand All @@ -489,6 +488,8 @@ window.createMap = function () {
}
}

map.setView([-params.z, params.x], params.zoom);

updateHash();
};

Expand Down

0 comments on commit 900e796

Please sign in to comment.