-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add "offset" support to CSS styles #117
Conversation
Awesome. This looks very promising, thanks you. I only think that the usefulness of this feature highly depends on implementing mapcss layers (#118) also. PS: Can you please finish up this pull request by adding the new library to the makefile as well, dropping the library's example and readme files, and adding a short attribution link on the index files? (Sorry that there are no contributor guidelines yet.) Btw: Can you please finish up this pull request by adding the new library to the makefile as well, dropping the library's example and readme files, and adding a short attribution link on the index files? (Sorry that there are no contributor guidelines yet.) |
Yes, usability depends a lot on #118. Though it's a separate feature and is cleaner to be committed separately IMO. I added the lib to the makefile and added attribution. I noticed that the signing was different, so I now adapted that in the code. But also asked if the signing was permanent (given that it's still a young library we use). |
Cool. I'm seeing some small circle artifacts when using a negative offset: link Is this expected behavior or an upstream bug in the PolylineOffset lib? |
//cc @bbecquet: Has this to do with bbecquet/Leaflet.PolylineOffset#1 maybe? |
@tyrasd not really. It's because the line goes about straight down, and the code gets problems with angle comparison. So it's a different issue from the one you mentioned. However, I've been able to improve the algorithms (both for bbecquet/Leaflet.PolylineOffset#1 and the issue mentioned here) and will publish them after some more testing. It's not yet perfect (it's hard to determine angles when the points are very close), but it should take more of those close cases into account, and ignore those points (i.e. just draw a line over it). |
Offset code of mapcss for nodes would be interesting to make forward/backward , and side differences for example as we can do with https://github.com/yopaseopor/traffic_signs_style_JOSM. |
By using the scripts from https://github.com/bbecquet/Leaflet.PolylineOffset,
it's very easy to add offset support to the CSS style (f.e. to render cycle lanes, parking lanes, ... next to a road)
Example test query: