-
Notifications
You must be signed in to change notification settings - Fork 964
Switch to inline colourable markers #5854
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
base: master
Are you sure you want to change the base?
Conversation
20f1ebb
to
20e655b
Compare
efa51b2
to
cb0e3d3
Compare
485c74e
to
7806af3
Compare
322a722
to
8bb6564
Compare
@tomhughes do you think it's better to match the current marker colors more closely or to reduce variations in color (only have one green, one red...)? |
I couldn't see that much of a difference to be honest - there was a bit of one with the routing markers but nothing terrible. I know this overlaps with work @AntonKhorev has been doing though which is why I've asked him to review it. |
The only other thing that struck me was the various hex colour constants scattered around but I'm not sure there's any good way to centralise them. |
Description
This is an attempt at parametrifying marker colors with
currentColor
since it has come up in #5764.Together with optimizing the path geometry, this required rewriting the marker layout to be compatible with partially transparent gradients.
While an even simpler path has been proposed and demonstrated in https://antonkhorev.github.io/msvgen, I was searching for a solution without a sudden change in curvature, which I found by constraining a Bezier curve to a specified slope, 1.92 in this case.1 (See CodePen)
Where I had the source colors, I tried to fit the colors to the sources, e.g. for the note markers see this before/after:

For now, this is only a barebones switch to the new markers, but moving in the direction of #872 (comment), #2787 or #507
Closes #5764.
How has this been tested?
Server side and client/browser side separately, no integration testing though.
Considerations
For the raster icons where I didn't have the colors, I took them from the note markers, so
Footnotes
Leaflet's marker.svg actually has two slopes for the tip, 1.9205 on the left and 1.9296 on the right ↩