Skip to content

Commit

Permalink
Fix panning maintaining state
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMacocian committed Aug 11, 2024
1 parent 5ca1ba3 commit a05ab8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion GuildWarsPartySearch.FrontEnd/Content/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,13 @@ function updateHash() {
var zoom = map.getZoom();
var point = project(map.getCenter());

history.replaceState(undefined, undefined, "?v=1&x=" + point.x + "&y=" + point.y + "&z=" + zoom + "&c=" + continent);
const url = new URL(window.location.href);
url.searchParams.set("v", 1);
url.searchParams.set("x", point.x);
url.searchParams.set("y", point.y);
url.searchParams.set("z", zoom);
url.searchParams.set("c", continent);
window.history.replaceState({}, '', url);
}

function getURLParameter(name) {
Expand Down
2 changes: 1 addition & 1 deletion GuildWarsPartySearch.FrontEnd/Content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@
</tbody>
</table>
</div>
<script src="app.js?v=20240811001"></script>
<script src="app.js?v=20240811002"></script>
</body>
</html>

0 comments on commit a05ab8d

Please sign in to comment.