]> git.openstreetmap.org Git - rails.git/blob - app/assets/javascripts/leaflet.thunderforest.js
Merge remote-tracking branch 'upstream/pull/6993'
[rails.git] / app / assets / javascripts / leaflet.thunderforest.js
1 //= require maplibre/i18n
2
3 L.OSM.ThunderforestVector = L.OSM.MaplibreGL.extend({
4   onAdd: function (map) {
5     L.OSM.MaplibreGL.prototype.onAdd.call(this, map);
6     const styleURL = "https://api.thunderforest.com/styles/" + this.options.styleName + "/style.json?key=" + this.options.apikey;
7     this.getMaplibreMap().setStyle(styleURL);
8   },
9   onRemove: function (map) {
10     L.OSM.MaplibreGL.prototype.onRemove.call(this, map);
11   }
12 });
13
14 L.OSM.TransportMapVector = L.OSM.ThunderforestVector.extend({
15   options: {
16     styleName: "transport"
17   }
18 });
19
20 L.OSM.TransportDarkMapVector = L.OSM.ThunderforestVector.extend({
21   options: {
22     styleName: "transport-dark"
23   }
24 });