[openstreetmap/openstreetmap-website] Minimap migration from Leaflet to MapLibre (PR #6683)
Frank Elsinga
notifications at github.com
Wed Jan 7 03:01:44 UTC 2026
@CommanderStorm commented on this pull request.
> @@ -16,21 +20,27 @@ L.OSM.layers = function (options) {
input.checked = map.hasLayer(layer);
map.whenReady(function () {
- const miniMap = L.map(container, { attributionControl: false, zoomControl: false, keyboard: false })
- .addLayer(new layer.constructor(layer.options));
+ const styleId = layer.options.leafletOsmId;
+ const style = OSM.MapLibre.Styles[styleId](layer.options);
+ const miniMap = new maplibregl.Map({
+ container,
+ style,
+ interactive: false,
+ attributionControl: false,
+ fadeDuration: 0
In production, we would want this for better performance and maybe (depending how bundling works) slightly smaller size.
How do I access if we are in prod or dev?
https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/#validatestyle
```suggestion
fadeDuration: 0,
validatestyle: false
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6683#pullrequestreview-3633182237
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6683/review/3633182237 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260106/f722e6ad/attachment.htm>
More information about the rails-dev
mailing list