Skip to content

Commit ef6802e

Browse files
committed
Update maps from map tile API v2 to raster tile API v3
1 parent d3f8ade commit ef6802e

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22
const LIGHTMODE_TILE_URL =
3-
'https://compass-maps.mongodb.com/compass/maptile/reduced.day/{z}/{x}/{y}/512';
3+
'https://compass-maps.mongodb.com/compass/maptile/v3/lite.day/{z}/{x}/{y}/512';
44
const DARKMODE_TILE_URL =
5-
'https://compass-maps.mongodb.com/compass/maptile/reduced.night/{z}/{x}/{y}/512';
5+
'https://compass-maps.mongodb.com/compass/maptile/v3/lite.night/{z}/{x}/{y}/512';
66

77
// The copyright url for HERE maps, if we're using the default tile url
8-
const COPYRIGHT_URL = 'https://compass-maps.mongodb.com/compass/copyright';
8+
const COPYRIGHT_URL = 'https://compass-maps.mongodb.com/compass/copyright/v3';
99

1010
export { LIGHTMODE_TILE_URL, DARKMODE_TILE_URL, COPYRIGHT_URL };

packages/compass-schema/src/components/coordinates-minichart/utils.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ export async function _getHereTileBoxes() {
1212
const rawTileBoxes = await fetch(COPYRIGHT_URL).then((response) =>
1313
response.json()
1414
);
15-
return rawTileBoxes.normal.map((attr) => ({
16-
...attr,
17-
boxes: attr.boxes.map((box) =>
18-
L.latLngBounds(L.latLng(box[0], box[1]), L.latLng(box[2], box[3]))
19-
),
20-
}));
15+
const result = rawTileBoxes.copyrights.in
16+
.map((notice) => ({
17+
alt: notice.copyrightText,
18+
label: notice.label,
19+
maxLevel: notice.maxLevel,
20+
minLevel: notice.minLevel,
21+
boxes: notice.boundingBoxes.map((box) =>
22+
L.latLngBounds(
23+
L.latLng(box.south, box.west),
24+
L.latLng(box.north, box.east)
25+
)
26+
),
27+
}))
28+
.flat();
29+
return result;
2130
}
2231

2332
function cachedGetHereTileBoxes() {

0 commit comments

Comments
 (0)