-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polyline layer turns black after turning off all legend filters (legend: true
+ preferCanvas: false
)
#272
Comments
Hi @hupe13,
It should be the intended behavior (somehow related to: #235).
Actually, the following should be the real cause: leaflet-elevation/src/control.js Lines 912 to 913 in ea15556
Probably not implemented on canvas layers:
where CSS rules must be transposed into JS code, eg: 👋 Raruto |
legend: true
+ preferCanvas: false
)
legend: true
+ preferCanvas: false
)legend: true
+ preferCanvas: false
)
Hi Raruto, after setting Thank you very much. |
There are many (other) problems with setting
Yes, it should be: // toggle layer visibility on empty chart
this._layers.eachLayer(layer => layer.getElement && this._chartEnabled && this.options.polyline.className && _.toggleClass(layer.getElement && layer.getElement(), this.options.polyline.className + ' ' + this.options.theme, this._chartEnabled)); ` |
@hupe13 umph, some additional code explanation would help (it's somewhat a cryptic condition). Also, if you feel you have the time: 👉 gifcap.dev (just to show the before/after to others). 👋 Raruto |
The problem in my first post was about the black polyline when all legend filters are turned off. You told me two possibilities to solve the problem:
First, I set |
Hi Raruto, I changed this: leaflet-elevation/src/control.js Line 913 in bd9316b
this._layers.eachLayer(layer => layer.getElement && this._chartEnabled && this.options.polyline.className && _.toggleClass(layer.getElement && layer.getElement(), this.options.polyline.className + ' ' + this.options.theme, this._chartEnabled)); I tested it with your example using custom colors. You can see, it works. Toggle Altitude on and off. |
Hi Raruto,
if I toggle all chart legend filter off, the polyline is black. Example.
Your example works as expected.
If I comment out these lines
leaflet-elevation/src/control.js
Lines 919 to 922 in ea15556
it works for me too.
What is the expected behavior? Or what is missing in my code?
Thank you very much.
The text was updated successfully, but these errors were encountered: