fix map panning to objects when url hash is not empty but has no map location, fixes #865

This commit is contained in:
Martin Raifer 2025-02-15 16:54:24 +01:00
parent 8ecbe9b07d
commit b14965e4b2
No known key found for this signature in database
GPG key ID: 3CD561F7B1C461BD
3 changed files with 17 additions and 17 deletions

View file

@ -12,9 +12,10 @@ OSM.Changeset = function (map) {
const changesetData = content.find("[data-changeset]").data("changeset");
changesetData.type = "changeset";
var hashParams = OSM.parseHash(window.location.hash);
initialize();
map.addObject(changesetData, function (bounds) {
if (!window.location.hash && bounds.isValid()) {
if (!hashParams.center && bounds.isValid()) {
OSM.router.withoutMoveListener(function () {
map.fitBounds(bounds);
});