@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/3014051...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to