Set track color yellow for CyclOSM (#297)

This commit is contained in:
Norbert Renner 2020-06-02 22:09:22 +02:00
parent a0fe3c8824
commit 9fd9a52a8c

View file

@ -3,7 +3,13 @@ BR.tracksLoader = function(map, layersControl, routing) {
options: {
layer: L.geoJson,
layerOptions: {
style: { color: 'blue' },
style: function(geoJsonFeature) {
var currentLayerId = layersControl.getActiveBaseLayer().layer.id;
return {
color: currentLayerId === 'cyclosm' ? 'yellow' : 'blue',
weight: 4
};
},
interactive: false,
pointToLayer: function(geoJsonPoint, latlng) {
return L.marker(latlng, {