From 407234982b739cb10cd6174e53581dc314c0b38e Mon Sep 17 00:00:00 2001 From: IreuN Date: Tue, 3 Dec 2024 19:56:51 +0100 Subject: [PATCH 1/3] Prefetch 1024px img in case of PANO photo --- .../josm/plugins/mapillary/cache/MapillaryCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java index c87682dc9..df25a1ba7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java @@ -176,7 +176,7 @@ private static void runnableCacheSurroundingImages(INode currentImage) { } final IWay iWay = MapillaryImageUtils.getSequence(currentImage); // We prefetch both ways - final Type type = Type.THUMB_256; + final Type type = MapillaryImageUtils.IS_PANORAMIC.test(currentImage) ? Type.THUMB_1024 : Type.THUMB_256; // Prefetch larger pic in case of Pano photo. if (iWay != null) { // Avoid CME -- getImage may remove nodes from the way final List wayNodes = new ArrayList<>(iWay.getNodes()); From 6c49c7b18010cb26d0bf0da29e7f4b22da2cc77f Mon Sep 17 00:00:00 2001 From: IreuN Date: Tue, 3 Dec 2024 19:56:51 +0100 Subject: [PATCH 2/3] Prefetch 1024px img in case of PANO photo Signed-off-by: IreuN --- .../josm/plugins/mapillary/cache/MapillaryCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java index c87682dc9..df25a1ba7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java @@ -176,7 +176,7 @@ private static void runnableCacheSurroundingImages(INode currentImage) { } final IWay iWay = MapillaryImageUtils.getSequence(currentImage); // We prefetch both ways - final Type type = Type.THUMB_256; + final Type type = MapillaryImageUtils.IS_PANORAMIC.test(currentImage) ? Type.THUMB_1024 : Type.THUMB_256; // Prefetch larger pic in case of Pano photo. if (iWay != null) { // Avoid CME -- getImage may remove nodes from the way final List wayNodes = new ArrayList<>(iWay.getNodes()); From 560c9304dc61cbf4449d077cf795eaa2bac1e33e Mon Sep 17 00:00:00 2001 From: IreuN Date: Wed, 4 Dec 2024 01:20:13 +0100 Subject: [PATCH 3/3] Actually open the image and not the map via URL --- .../josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java | 2 +- .../josm/plugins/mapillary/utils/MapillaryURLTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java index 300517b9e..7d78abfd2 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java @@ -320,7 +320,7 @@ default URI browseImage(String key) { if (key == null) { throw new IllegalArgumentException("The image key must not be null!"); } - return string2URL(getBaseUrl(), "app/?pKey=", key); + return string2URL(getBaseUrl(), "app/?pKey=", key, "&focus=photo"); } /** diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java index 1cda1a4c7..5c2cc09ca 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java @@ -26,7 +26,7 @@ class MapillaryURLTest { @Test void testBrowseImageURL() { - assertEquals(URI.create("https://www.mapillary.com/app/?pKey=1234567890123456789012"), + assertEquals(URI.create("https://www.mapillary.com/app/?pKey=1234567890123456789012&focus=photo"), MapillaryConfig.getUrls().browseImage("1234567890123456789012")); }