mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-26 01:47:49 +02:00
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:
@@ -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]]);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user