@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/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to