Skip to content

Commit 06cba01

Browse files
committed
fix maplibre gl js
1 parent 9f021ed commit 06cba01

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/evmap_backend/forms/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ class MapLibreWidget(BaseGeometryWidget):
55
template_name = "widgets/maplibre.html"
66

77
class Media:
8-
css = {"all": ("https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css",)}
8+
css = {"all": ("https://unpkg.com/maplibre-gl@^5.24.0/dist/maplibre-gl.css",)}
99
js = (
10-
"https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js",
10+
"https://unpkg.com/maplibre-gl@^5.24.0/dist/maplibre-gl.js",
1111
"widgets/maplibre.js",
1212
)
1313

src/templates/playground.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@
3838
.site-detail .loading { color: #999; }
3939
.site-detail td.utilization-cell { text-align:center; font-size:11px; padding: 2px 0px; width: 26px; }
4040
</style>
41-
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet'/>
41+
<link href='https://unpkg.com/maplibre-gl@^6.0.0/dist/maplibre-gl.css' rel='stylesheet'/>
4242
</head>
4343
<body>
4444
<div id="map"></div>
45-
<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
46-
<script>
45+
<script type="module">
46+
import * as maplibregl from 'https://unpkg.com/maplibre-gl@^6.0.0/dist/maplibre-gl.mjs';
47+
4748
var map = new maplibregl.Map({
4849
container: 'map',
4950
style: 'https://tiles.openfreemap.org/styles/bright', // stylesheet location

0 commit comments

Comments
 (0)