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
This commit is contained in:
Martin Raifer
2024-08-08 14:44:50 +02:00
parent 43dab66b3a
commit 9e239df569
2 changed files with 7 additions and 2 deletions

View File

@@ -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,