Skip to content

Commit 6e46a94

Browse files
committed
Update Maplibre to version 5 (apache#924)
* Update Maplibre to version 5 * Add CSP Directive
1 parent 44c9684 commit 6e46a94

File tree

8 files changed

+218
-98
lines changed

8 files changed

+218
-98
lines changed

baremaps-renderer/package-lock.json

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

baremaps-renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"chalk": "^4",
1717
"commander": "^10.0.1",
1818
"http": "^0.0.1-security",
19-
"maplibre-gl": "^2.4.0",
19+
"maplibre-gl": "^5.0.1",
2020
"pixelmatch": "^5.3.0",
2121
"pngjs": "^7.0.0",
2222
"puppeteer": "^20.2.0",

baremaps-renderer/src/lib/maplibreBrowserHelpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export class MaplibreBrowserHelpers {
5454
}
5555

5656
await page.addScriptTag({
57-
url: 'https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js',
57+
url: 'https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js',
5858
});
5959
await page.addStyleTag({
60-
url: 'https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css',
60+
url: 'https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.css',
6161
});
6262
}
6363

baremaps-server/src/main/resources/dem/index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,21 @@
2121
<meta property="og:description" content="Digital Elevation Model (DEM)" />
2222
<meta charset='utf-8'>
2323
<meta name="viewport" content="width=device-width, initial-scale=1">
24-
<script src="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js" integrity="sha256-RU7N55x2fpxos26u6Mrn26qPlDih4ZiqZMstWPipnGE=" crossorigin="anonymous"></script>
24+
<meta http-equiv="Content-Security-Policy" content="
25+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
26+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
27+
worker-src 'self' blob:;
28+
child-src 'self' blob:;
29+
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
30+
style-src 'self' 'unsafe-inline' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
31+
">
32+
33+
<script src="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js" integrity="sha256-VkgYz8vlPsIndJcxwEDZKAdx4r+Ag7HcLBPP4UbJrZE=" crossorigin="anonymous"></script>
2534
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js" integrity="sha256-NYdRoIbqeAWkTHjpa/BukMLXcsiqFoDuJCYzzaRei30=" crossorigin="anonymous"></script>
2635
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js" integrity="sha256-Jo8NvxMzooqayU8+eIsjO49b4EoakoE0o0tSSrBWPCU=" crossorigin="anonymous"></script>
2736
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.js" integrity="sha256-80a3VIbp5OJ8HSIWJ7+6NjTvdBmVirLCR6otKucXnlw=" crossorigin="anonymous"></script>
2837
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-framerate.js" integrity="sha256-6IVzv2heNDAl7KkSqjRkmjr56asfkdCxO2q8ouTo8t8=" crossorigin="anonymous"></script>
29-
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css" integrity="sha256-V2sIX92Uh6ZaGSFTKMHghsB85b9toJtmazgG09AI2uk=" crossorigin="anonymous">
38+
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.css" integrity="sha256-eSrJl9z2rm9kPrTi3uRjDIXnBWUmvY+4X/6Dxn1sQbQ=" crossorigin="anonymous">
3039
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css" integrity="sha256-ePhsoaklgbCBxK7kfSUcP+V+bVqnfFwpILz7hkSR0Lo=" crossorigin="anonymous">
3140
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css" integrity="sha256-FxIRliWXnU67sT1i97MgNQ0qL8LjsgYiBH9v/uNxzdM=" crossorigin="anonymous">
3241
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.css" integrity="sha256-rFc19qrZTPgcrNeYjtsLCcDOqM5NrLiPy2U+0FxW9vA=" crossorigin="anonymous">

baremaps-server/src/main/resources/static/server.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@
1717
-->
1818
<html lang="en">
1919
<head>
20-
<script src="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js" integrity="sha256-RU7N55x2fpxos26u6Mrn26qPlDih4ZiqZMstWPipnGE=" crossorigin="anonymous"></script>
20+
<meta http-equiv="Content-Security-Policy" content="
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
23+
worker-src 'self' blob:;
24+
child-src 'self' blob:;
25+
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
26+
style-src 'self' 'unsafe-inline' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
27+
">
28+
29+
<script src="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js" integrity="sha256-VkgYz8vlPsIndJcxwEDZKAdx4r+Ag7HcLBPP4UbJrZE=" crossorigin="anonymous"></script>
2130
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js" integrity="sha256-NYdRoIbqeAWkTHjpa/BukMLXcsiqFoDuJCYzzaRei30=" crossorigin="anonymous"></script>
2231
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js" integrity="sha256-Jo8NvxMzooqayU8+eIsjO49b4EoakoE0o0tSSrBWPCU=" crossorigin="anonymous"></script>
2332
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.js" integrity="sha256-80a3VIbp5OJ8HSIWJ7+6NjTvdBmVirLCR6otKucXnlw=" crossorigin="anonymous"></script>
2433
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-framerate.js" integrity="sha256-6IVzv2heNDAl7KkSqjRkmjr56asfkdCxO2q8ouTo8t8=" crossorigin="anonymous"></script>
25-
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css" integrity="sha256-V2sIX92Uh6ZaGSFTKMHghsB85b9toJtmazgG09AI2uk=" crossorigin="anonymous">
34+
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.css" integrity="sha256-eSrJl9z2rm9kPrTi3uRjDIXnBWUmvY+4X/6Dxn1sQbQ=" crossorigin="anonymous">
2635
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css" integrity="sha256-ePhsoaklgbCBxK7kfSUcP+V+bVqnfFwpILz7hkSR0Lo=" crossorigin="anonymous">
2736
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css" integrity="sha256-FxIRliWXnU67sT1i97MgNQ0qL8LjsgYiBH9v/uNxzdM=" crossorigin="anonymous">
2837
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.css" integrity="sha256-rFc19qrZTPgcrNeYjtsLCcDOqM5NrLiPy2U+0FxW9vA=" crossorigin="anonymous">

baremaps-server/src/main/resources/static/viewer.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@
1717
-->
1818
<html lang="en">
1919
<head>
20-
<script src="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js" integrity="sha256-RU7N55x2fpxos26u6Mrn26qPlDih4ZiqZMstWPipnGE=" crossorigin="anonymous"></script>
20+
<meta http-equiv="Content-Security-Policy" content="
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
23+
worker-src 'self' blob:;
24+
child-src 'self' blob:;
25+
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
26+
style-src 'self' 'unsafe-inline' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
27+
">
28+
29+
<script src="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js" integrity="sha256-VkgYz8vlPsIndJcxwEDZKAdx4r+Ag7HcLBPP4UbJrZE=" crossorigin="anonymous"></script>
2130
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js" integrity="sha256-NYdRoIbqeAWkTHjpa/BukMLXcsiqFoDuJCYzzaRei30=" crossorigin="anonymous"></script>
2231
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js" integrity="sha256-Jo8NvxMzooqayU8+eIsjO49b4EoakoE0o0tSSrBWPCU=" crossorigin="anonymous"></script>
2332
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.js" integrity="sha256-80a3VIbp5OJ8HSIWJ7+6NjTvdBmVirLCR6otKucXnlw=" crossorigin="anonymous"></script>
2433
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-framerate.js" integrity="sha256-6IVzv2heNDAl7KkSqjRkmjr56asfkdCxO2q8ouTo8t8=" crossorigin="anonymous"></script>
25-
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css" integrity="sha256-V2sIX92Uh6ZaGSFTKMHghsB85b9toJtmazgG09AI2uk=" crossorigin="anonymous">
34+
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.css" integrity="sha256-eSrJl9z2rm9kPrTi3uRjDIXnBWUmvY+4X/6Dxn1sQbQ=" crossorigin="anonymous">
2635
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css" integrity="sha256-ePhsoaklgbCBxK7kfSUcP+V+bVqnfFwpILz7hkSR0Lo=" crossorigin="anonymous">
2736
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css" integrity="sha256-FxIRliWXnU67sT1i97MgNQ0qL8LjsgYiBH9v/uNxzdM=" crossorigin="anonymous">
2837
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.css" integrity="sha256-rFc19qrZTPgcrNeYjtsLCcDOqM5NrLiPy2U+0FxW9vA=" crossorigin="anonymous">

basemap/index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@
1717
-->
1818
<html lang="en">
1919
<head>
20-
<script src="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js" integrity="sha256-RU7N55x2fpxos26u6Mrn26qPlDih4ZiqZMstWPipnGE=" crossorigin="anonymous"></script>
20+
<meta http-equiv="Content-Security-Policy" content="
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
23+
worker-src 'self' blob:;
24+
child-src 'self' blob:;
25+
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
26+
style-src 'self' 'unsafe-inline' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
27+
">
28+
29+
<script src="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js" integrity="sha256-VkgYz8vlPsIndJcxwEDZKAdx4r+Ag7HcLBPP4UbJrZE=" crossorigin="anonymous"></script>
2130
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js" integrity="sha256-NYdRoIbqeAWkTHjpa/BukMLXcsiqFoDuJCYzzaRei30=" crossorigin="anonymous"></script>
2231
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js" integrity="sha256-Jo8NvxMzooqayU8+eIsjO49b4EoakoE0o0tSSrBWPCU=" crossorigin="anonymous"></script>
2332
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.js" integrity="sha256-80a3VIbp5OJ8HSIWJ7+6NjTvdBmVirLCR6otKucXnlw=" crossorigin="anonymous"></script>
2433
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-framerate.js" integrity="sha256-6IVzv2heNDAl7KkSqjRkmjr56asfkdCxO2q8ouTo8t8=" crossorigin="anonymous"></script>
25-
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css" integrity="sha256-V2sIX92Uh6ZaGSFTKMHghsB85b9toJtmazgG09AI2uk=" crossorigin="anonymous">
34+
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.css" integrity="sha256-eSrJl9z2rm9kPrTi3uRjDIXnBWUmvY+4X/6Dxn1sQbQ=" crossorigin="anonymous">
2635
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css" integrity="sha256-ePhsoaklgbCBxK7kfSUcP+V+bVqnfFwpILz7hkSR0Lo=" crossorigin="anonymous">
2736
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css" integrity="sha256-FxIRliWXnU67sT1i97MgNQ0qL8LjsgYiBH9v/uNxzdM=" crossorigin="anonymous">
2837
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.css" integrity="sha256-rFc19qrZTPgcrNeYjtsLCcDOqM5NrLiPy2U+0FxW9vA=" crossorigin="anonymous">

examples/openstreetmap/index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@
1717
-->
1818
<html lang="en">
1919
<head>
20-
<script src="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js" integrity="sha256-RU7N55x2fpxos26u6Mrn26qPlDih4ZiqZMstWPipnGE=" crossorigin="anonymous"></script>
20+
<meta http-equiv="Content-Security-Policy" content="
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
23+
worker-src 'self' blob:;
24+
child-src 'self' blob:;
25+
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
26+
style-src 'self' 'unsafe-inline' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
27+
">
28+
29+
<script src="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.js" integrity="sha256-VkgYz8vlPsIndJcxwEDZKAdx4r+Ag7HcLBPP4UbJrZE=" crossorigin="anonymous"></script>
2130
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js" integrity="sha256-NYdRoIbqeAWkTHjpa/BukMLXcsiqFoDuJCYzzaRei30=" crossorigin="anonymous"></script>
2231
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js" integrity="sha256-Jo8NvxMzooqayU8+eIsjO49b4EoakoE0o0tSSrBWPCU=" crossorigin="anonymous"></script>
2332
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.js" integrity="sha256-80a3VIbp5OJ8HSIWJ7+6NjTvdBmVirLCR6otKucXnlw=" crossorigin="anonymous"></script>
2433
<script src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-framerate.js" integrity="sha256-6IVzv2heNDAl7KkSqjRkmjr56asfkdCxO2q8ouTo8t8=" crossorigin="anonymous"></script>
25-
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css" integrity="sha256-V2sIX92Uh6ZaGSFTKMHghsB85b9toJtmazgG09AI2uk=" crossorigin="anonymous">
34+
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@5.0.1/dist/maplibre-gl.css" integrity="sha256-eSrJl9z2rm9kPrTi3uRjDIXnBWUmvY+4X/6Dxn1sQbQ=" crossorigin="anonymous">
2635
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css" integrity="sha256-ePhsoaklgbCBxK7kfSUcP+V+bVqnfFwpILz7hkSR0Lo=" crossorigin="anonymous">
2736
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css" integrity="sha256-FxIRliWXnU67sT1i97MgNQ0qL8LjsgYiBH9v/uNxzdM=" crossorigin="anonymous">
2837
<link rel="stylesheet" href="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.css" integrity="sha256-rFc19qrZTPgcrNeYjtsLCcDOqM5NrLiPy2U+0FxW9vA=" crossorigin="anonymous">

0 commit comments

Comments
 (0)