switch to Bing Maps API for Bing Streetside layer, fixes #10074

replaces the use of undocumented APIs for Microsoft's street level imagery service and gets rid of hardcoded values, e.g. for the `g` ("generation") parameter

see https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata#get-streetside-metadata-centered-at-a-point for API docs

see also #10100
This commit is contained in:
Martin Raifer
2024-02-16 18:20:21 +01:00
parent 4829f8a1da
commit 83754e4a4a
6 changed files with 97 additions and 207 deletions
+11
View File
@@ -247,4 +247,15 @@ describe('iD.geoExtent', function () {
});
describe('#split', function () {
it('splits into four parts', function () {
var splits = iD.geoExtent([0, 10], [5, 20]).split();
expect(splits).to.have.length(4);
expect(splits[0]).to.eql([[0, 10], [2.5, 15]]);
expect(splits[1]).to.eql([[2.5, 10], [5, 15]]);
expect(splits[2]).to.eql([[2.5, 15], [5, 20]]);
expect(splits[3]).to.eql([[0, 15], [2.5, 20]]);
});
});
});
+20 -34
View File
@@ -58,23 +58,16 @@ describe('iD.serviceStreetside', function() {
var spy = sinon.spy();
streetside.on('loadedImages', spy);
window.JSONP_DELAY = 0;
window.JSONP_FIX = [{
elapsed: 0.001
}, {
id: 1, la: 0, lo: 10.001, al: 0, ro: 0, pi: 0, he: 0, bl: '',
cd: '1/1/2018 12:00:00 PM', ml: 3, nbn: [], pbn: [], rn: [],
pr: undefined, ne: 2
}, {
id: 2, la: 0, lo: 10.002, al: 0, ro: 0, pi: 0, he: 0, bl: '',
cd: '1/1/2018 12:00:01 PM', ml: 3, nbn: [], pbn: [], rn: [],
pr: 1, ne: 3
}, {
id: 3, la: 0, lo: 10.003, al: 0, ro: 0, pi: 0, he: 0, bl: '',
cd: '1/1/2018 12:00:02 PM', ml: 3, nbn: [], pbn: [], rn: [],
pr: 2, ne: undefined
}
];
var mockData = {
resourceSets: [{
resources: []
}]
};
fetchMock.mock(/MetaData\/Streetside/, {
body: JSON.stringify(mockData),
status: 200
});
streetside.loadBubbles(context.projection, 0); // 0 = don't fetch margin tiles
@@ -93,23 +86,16 @@ describe('iD.serviceStreetside', function() {
var spy = sinon.spy();
streetside.on('loadedImages', spy);
window.JSONP_DELAY = 0;
window.JSONP_FIX = [{
elapsed: 0.001
}, {
id: 1, la: 0, lo: 0, al: 0, ro: 0, pi: 0, he: 0, bl: '',
cd: '1/1/2018 12:00:00 PM', ml: 3, nbn: [], pbn: [], rn: [],
pr: undefined, ne: 2
}, {
id: 2, la: 0, lo: 0, al: 0, ro: 0, pi: 0, he: 0, bl: '',
cd: '1/1/2018 12:00:01 PM', ml: 3, nbn: [], pbn: [], rn: [],
pr: 1, ne: 3
}, {
id: 3, la: 0, lo: 0, al: 0, ro: 0, pi: 0, he: 0, bl: '',
cd: '1/1/2018 12:00:02 PM', ml: 3, nbn: [], pbn: [], rn: [],
pr: 2, ne: undefined
}
];
var mockData = {
resourceSets: [{
resources: [{}]
}]
};
fetchMock.mock(/MetaData\/Streetside/, {
body: JSON.stringify(mockData),
status: 200
});
streetside.loadBubbles(context.projection, 0); // 0 = don't fetch margin tiles