[openstreetmap/openstreetmap-website] Minimap migration from Leaflet to MapLibre (PR #6683)
Tom Hughes
notifications at github.com
Sun Jan 18 11:09:37 UTC 2026
@tomhughes commented on this pull request.
> +OSM.MapLibre.Styles.ShortbreadColorful = (options) => `https://vector.openstreetmap.org/styles/shortbread/${options.styleName}`;
+OSM.MapLibre.Styles.ShortbreadEclipse = (options) => `https://vector.openstreetmap.org/styles/shortbread/${options.styleName}`;
+OSM.MapLibre.Styles.OpenMapTiles = (options) => `https://api.maptiler.com/maps/openstreetmap/style.json?key=${options.apikey}`;
Isn't this creating these as raster layers rather than vector layers?
> + if (layer.options.leafletOsmId === "OpenMapTiles") {
+ OSM.MapLibre.setMapLanguage(miniMap);
+ }
So this is setting the language (which currently only affects the OpenMapTiles layer) but only if the main map is showing OpenMapTiles which seems wrong as the behaviour of the minimap for OpenMapTiles will depend on what main map is doing?
Plus it's changing global state anyway, and once at page load time (once the main map is initialised) so it depends on the initial layer.
As the language is global state I suspect it should just be set once when MapLibre is initialised and regardless of what layers are active?
> + function animateZoomToMatchMainMap() {
+ miniMap.zoomTo(getMiniMapZoom(), { duration: 300 });
+ }
+ function setZoomToMatchMainMap() {
+ miniMap.setZoom(getMiniMapZoom());
+ }
+ function getMiniMapZoom() {
Can add a blank line before each of these functions please, for consistency with the other functions here if nothing else.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6683#pullrequestreview-3675409610
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6683/review/3675409610 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260118/646f5c20/attachment.htm>
More information about the rails-dev
mailing list