From ade83ba6e0cf9c8d31023c85c0b2a475b539f99f Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Fri, 4 Apr 2025 13:53:18 +0200 Subject: [PATCH] extend kartaview's domain hotpatching, use full resolution images, fixes #10927 --- CHANGELOG.md | 2 ++ modules/services/kartaview.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fca5636a..caecfcc62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ _Breaking developer changes, which may affect downstream projects or sites that * Add keyboard shortcut `Shift + P` to toggle active street level photo layers ([#10394], thanks [@mattiapezzotti])) * Add prev/next button to viewer for local georeferenced photos ([#10852], thanks [@0xatulpatil]) * Add button to directly attach the id of a Panoramax photo as the `panoramax` tag of selected map features ([#10856], thanks [@MohamedAli00949]) +* Fix unreliable availability of KartaView images by requesting full resolution images ([#10927]) #### :white_check_mark: Validation * The Suspicious Names validator warning now also compares the Name field to the preset’s aliases (in addition to the preset’s name) in the user’s language #### :bug: Bugfixes @@ -78,6 +79,7 @@ _Breaking developer changes, which may affect downstream projects or sites that [#10885]: https://github.com/openstreetmap/iD/issues/10885 [#10910]: https://github.com/openstreetmap/iD/pull/10910 [#10916]: https://github.com/openstreetmap/iD/pull/10916 +[#10927]: https://github.com/openstreetmap/iD/issues/10927 [id-tagging-schema#609]: https://github.com/openstreetmap/id-tagging-schema/issues/609 [@0xatulpatil]: https://github.com/0xatulpatil [@MohamedAli00949]: https://github.com/MohamedAli00949 diff --git a/modules/services/kartaview.js b/modules/services/kartaview.js index ace31f5a6..da289c0c4 100644 --- a/modules/services/kartaview.js +++ b/modules/services/kartaview.js @@ -105,7 +105,7 @@ function loadNextTilePage(which, currZoom, url, tile) { ca: +item.heading, captured_at: (item.shot_date || item.date_added), captured_by: item.username, - imagePath: item.lth_name, + imagePath: item.name, sequence_id: item.sequence_id, sequence_index: +item.sequence_index }; @@ -444,7 +444,7 @@ export default { imageWrap .append('img') .attr('class', 'kartaview-image') - .attr('src', (apibase + '/' + d.imagePath).replace('https://kartaview.org/storage2/', 'https://storage2.openstreetcam.org/')) + .attr('src', (apibase + '/' + d.imagePath).replace(/^https:\/\/kartaview\.org\/storage(\d+)\//, 'https://storage$1.openstreetcam.org/')) .style('transform', 'rotate(' + r + 'deg)'); if (d.captured_by) {