[openstreetmap/openstreetmap-website] Add Shortbread-based vector tile layer (PR #6137)

Tom Hughes notifications at github.com
Sun Jul 13 10:14:47 UTC 2025


@tomhughes commented on this pull request.



>  L.extend(L.LatLngBounds.prototype, {
   getSize: function () {
     return (this._northEast.lat - this._southWest.lat) *
            (this._northEast.lng - this._southWest.lng);
   }
 });
 
+if (OSM.SHORTBREAD_STYLE_URL) {

The problem with making this conditional is that if there is no URL configured the class won't be defined but `layers.yml` will still reference the layer and hence we will try and use the class.

We either need to say the URL is mandatory, or we extend the layer definitions to allow the layer to be skipped.

On app/assets/javascripts/leaflet.map.js:

I think I would suggest actually creating two new files - a `leaflet.maplibregl.js` that does the maplibre requires and global configuration (basically just configuring the RTL plugin) and ` leaflet.shortbread.js` or something that requires `leaflet.maplibregl.js` and then defines the layer class.

That file should then be included in `application.js` alongside `leaflet.osm` that defines the other layers.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6137#pullrequestreview-3014051764
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6137/review/3014051764 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250713/54d7e796/attachment.htm>


More information about the rails-dev mailing list