Skip to content

Commit 4b5f6f8

Browse files
authored
app: upgrade to maplibre-gl 6.9 (#635)
* app: upgrade to maplibre-gl 6.9 * obviates need for loading rtl text plugin * render tests is using maplibre-gl 5.x * examples: fetch latest overture tileset using STAC catalog
1 parent a50c699 commit 4b5f6f8

8 files changed

Lines changed: 37 additions & 35 deletions

File tree

app/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<title>Protomaps Basemaps</title>
77
<link rel="preconnect" href="https://demo-bucket.protomaps.com"/>
88
<link rel="preconnect" href="https://build.protomaps.com"/>
9-
<link rel="preconnect" href="https://unpkg.com"/>
109
<link rel="preconnect" href="https://protomaps.github.io"/>
1110
</head>
1211
<body>

app/package-lock.json

Lines changed: 31 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
1616
"@maplibre/maplibre-gl-inspect": "^1.9.0",
17-
"maplibre-gl": "^6.0.0",
17+
"maplibre-gl": "^6.9.0",
1818
"pixelmatch": "^5.3.0",
1919
"pmtiles": "^4.5.0",
2020
"sirv": "^3.0.0",

app/src/MapView.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import {
1111
NavigationControl,
1212
Popup,
1313
addProtocol,
14-
getRTLTextPluginStatus,
1514
removeProtocol,
16-
setRTLTextPlugin,
1715
setWorkerUrl,
1816
} from "maplibre-gl";
1917
import * as maplibregl from "maplibre-gl";
@@ -260,13 +258,6 @@ function MapLibreView(props: {
260258
onMount(() => {
261259
props.ref?.({ fit });
262260

263-
if (getRTLTextPluginStatus() === "unavailable") {
264-
setRTLTextPlugin(
265-
"https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js",
266-
true,
267-
);
268-
}
269-
270261
if (!mapContainer) {
271262
console.error("Could not mount map element");
272263
return;

app/src/VisualTests.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ import pixelmatch from "pixelmatch";
1616

1717
maplibregl.setWorkerUrl(workerUrl);
1818

19-
if (maplibregl.getRTLTextPluginStatus() === "unavailable") {
20-
maplibregl.setRTLTextPlugin(
21-
"https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js",
22-
false, // we need to pre-load this, otherwise diffs will be flaky
23-
);
24-
}
25-
2619
// Jumps the map and waits for idle, capturing a Blob of the rendered frame.
2720
const moveAndCaptureBlob = (
2821
map: maplibregl.Map,

app/visualtests/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<link rel="preconnect" href="https://npm-style.protomaps.dev" crossorigin />
1010
<link rel="preconnect" href="https://registry.npmjs.org" crossorigin />
1111
<link rel="preconnect" href="https://protomaps.github.io" crossorigin />
12-
<link rel="preconnect" href="https://unpkg.com" crossorigin />
1312
</head>
1413
<body>
1514
<div id="root"></div>

examples/data_sandwich.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
</head>
1818
<body>
1919
<div id="map"></div>
20-
<script type="text/javascript">
20+
<script type="module">
21+
const latest_release = (await (await fetch("https://stac.overturemaps.org")).json()).latest;
22+
2123
let protocol = new pmtiles.Protocol();
2224
maplibregl.addProtocol("pmtiles", protocol.tile);
2325

2426
const map = new maplibregl.Map({
2527
container: "map",
26-
zoom: 13,
28+
zoom: 14,
2729
center: [-0.12,51.5],
2830
style: {
2931
version: 8,
@@ -37,7 +39,7 @@
3739
},
3840
overture_places: {
3941
type: "vector",
40-
url: "pmtiles://https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2024-12-18/places.pmtiles",
42+
url: `pmtiles://https://tiles.overturemaps.org/${latest_release}/places.pmtiles`,
4143
attribution: "<a href='https://overturemaps.org'>Overture Maps Foundation</a>"
4244
}
4345
},

render-tests/run_render_tests.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ async function getImageFromStyle(styleForTest: StyleWithTestData, page: Page): P
296296
reject(new Error('Test timed out'));
297297
}, options.timeout || 4000);
298298

299-
300299
if (maplibregl.getRTLTextPluginStatus() === 'unavailable') {
301300
maplibregl.setRTLTextPlugin(
302301
'https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js',

0 commit comments

Comments
 (0)