From 9e239df5690ae2c708db12d0fa824b574fbf991f Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Thu, 8 Aug 2024 14:44:50 +0200 Subject: [PATCH] fix intermittent issues with Bing Streetside API sometimes the API returns data in a format not matching the documented format (see https://learn.microsoft.com/en-us/bingmaps/articles/getting-streetside-tiles-from-imagery-metadata). see https://github.com/openstreetmap/iD/issues/10341#issuecomment-2275724738 closes #10341 --- CHANGELOG.md | 1 + modules/services/streetside.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc8bf7ea03..efa3e95ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :scissors: Operations #### :camera: Street-Level * Add Panoramax as new street level imagery provider ([#9941], thanks [@mattiapezzotti]) +* Fix intermittent issues with Bing Streetside sometimes returning API results in a undocumented format ([#10341]) #### :white_check_mark: Validation * Drop deprecated validation service _ImproveOSM_ ([#10302], thanks [@arch0345]) #### :bug: Bugfixes diff --git a/modules/services/streetside.js b/modules/services/streetside.js index def9bc0e3d..7f4893948a 100644 --- a/modules/services/streetside.js +++ b/modules/services/streetside.js @@ -114,14 +114,18 @@ function loadNextTilePage(which, url, tile) { const bubbleId = bubble.imageUrl; if (cache.points[bubbleId]) return null; // skip duplicates - const loc = [bubble.lon, bubble.lat]; + // workaround for https://github.com/openstreetmap/iD/issues/10341#issuecomment-2275724738 + const loc = [ + bubble.lon || bubble.longitude, + bubble.lat || bubble.latitude + ]; const d = { loc: loc, key: bubbleId, imageUrl: bubble.imageUrl.replace('{subdomain}', bubble.imageUrlSubdomains[0] ), - ca: bubble.he, + ca: bubble.he || bubble.heading, captured_at: bubble.vintageEnd, captured_by: 'microsoft', pano: true,