fix zoom resetting wrongly when switching background mid-transition

see https://github.com/openstreetmap/iD/issues/10700#issuecomment-2832010049
This commit is contained in:
Martin Raifer
2025-04-26 20:47:50 +02:00
parent 8c421b615d
commit fa91fe7c0d
12 changed files with 57 additions and 76 deletions
+6 -8
View File
@@ -554,15 +554,13 @@ export default {
updateUrlImage: function(imageKey) {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'kartaview/' + imageKey;
} else {
delete hash.photo;
}
window.location.replace('#' + utilQsString(hash, true));
const hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'kartaview/' + imageKey;
} else {
delete hash.photo;
}
window.history.replaceState(null, '', '#' + utilQsString(hash, true));
},
+6 -8
View File
@@ -308,15 +308,13 @@ export default {
},
updateUrlImage: function(imageKey) {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'mapilio/' + imageKey;
} else {
delete hash.photo;
}
window.location.replace('#' + utilQsString(hash, true));
const hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'mapilio/' + imageKey;
} else {
delete hash.photo;
}
window.history.replaceState(null, '', '#' + utilQsString(hash, true));
},
initViewer: function () {
+6 -8
View File
@@ -524,15 +524,13 @@ export default {
// Update the URL with current image id
updateUrlImage: function(imageId) {
if (!window.mocha) {
const hash = utilStringQs(window.location.hash);
if (imageId) {
hash.photo = 'mapillary/' + imageId;
} else {
delete hash.photo;
}
window.location.replace('#' + utilQsString(hash, true));
const hash = utilStringQs(window.location.hash);
if (imageId) {
hash.photo = 'mapillary/' + imageId;
} else {
delete hash.photo;
}
window.history.replaceState(null, '', '#' + utilQsString(hash, true));
},
+6 -8
View File
@@ -419,15 +419,13 @@ export default {
* @param {*} imageKey
*/
updateUrlImage: function(imageKey) {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'panoramax/' + imageKey;
} else {
delete hash.photo;
}
window.location.replace('#' + utilQsString(hash, true));
const hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'panoramax/' + imageKey;
} else {
delete hash.photo;
}
window.history.replaceState(null, '', '#' + utilQsString(hash, true));
},
/**
+6 -8
View File
@@ -905,15 +905,13 @@ export default {
updateUrlImage: function(imageKey) {
if (!window.mocha) {
var hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'streetside/' + imageKey;
} else {
delete hash.photo;
}
window.location.replace('#' + utilQsString(hash, true));
const hash = utilStringQs(window.location.hash);
if (imageKey) {
hash.photo = 'streetside/' + imageKey;
} else {
delete hash.photo;
}
window.history.replaceState(null, '', '#' + utilQsString(hash, true));
},
+6 -8
View File
@@ -584,15 +584,13 @@ export default {
},
updateUrlImage: function (key) {
if (!window.mocha) {
const hash = utilStringQs(window.location.hash);
if (key) {
hash.photo = 'vegbilder/' + key;
} else {
delete hash.photo;
}
window.location.replace('#' + utilQsString(hash, true));
const hash = utilStringQs(window.location.hash);
if (key) {
hash.photo = 'vegbilder/' + key;
} else {
delete hash.photo;
}
window.history.replaceState(null, '', '#' + utilQsString(hash, true));
},
validHere: function(extent) {