|
96 | 96 | }); |
97 | 97 |
|
98 | 98 | const key = '@@OPENSENSEMAP_ACCESS_TOKEN'; |
99 | | - const styleUrl = '@@OPENSENSEMAP_STYLE_URL' |
100 | | - const gl = L.maplibreGL({ |
101 | | - attribution: "\u003ca href=\"https://www.maptiler.com/copyright/\" target=\"_blank\"\u003e\u0026copy; MapTiler\u003c/a\u003e \u003ca href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\"\u003e\u0026copy; OpenStreetMap contributors\u003c/a\u003e", |
102 | | - style: styleUrl + "?key=" + key |
| 99 | + const styleUrl = '@@OPENSENSEMAP_STYLE_URL'; |
| 100 | + |
| 101 | + var gl = L.mapboxGL({ |
| 102 | + attribution: '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>', |
| 103 | + accessToken: '@@OPENSENSEMAP_ACCESS_TOKEN', |
| 104 | + style: '@@OPENSENSEMAP_STYLE_URL' |
103 | 105 | }).addTo(map); |
104 | | - var maplibreMap = gl.getMaplibreMap(); |
| 106 | + var mapboxMap = gl.getMapboxMap(); |
105 | 107 |
|
106 | | - maplibreMap.on('load', layerLoaded); |
| 108 | + mapboxMap.on('load', layerLoaded); |
107 | 109 |
|
108 | 110 | L.control.scale().addTo(map); |
109 | 111 |
|
|
153 | 155 | function layerLoaded () { |
154 | 156 | $rootScope.$broadcast('layerloaded', {}); |
155 | 157 | $rootScope.$apply(); |
156 | | - maplibreMap.off('load', layerLoaded); |
| 158 | + mapboxMap.off('load', layerLoaded); |
157 | 159 | for (var layerName in mapLayers) { |
158 | 160 | mapLayers[layerName].on('add', function () { |
159 | 161 | osemMapData.setLayer(layerName, mapLayers[layerName]); |
|
0 commit comments