Skip to content
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

Merged
merged 3 commits into from
Nov 21, 2014
Merged

Add "offset" support to CSS styles #117

merged 3 commits into from
Nov 21, 2014

Conversation

sanderd17
Copy link
Contributor

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:

way [highway=primary] ({{bbox}});
out geom;
{{style:
way
{
  offset: -30;
}
}}

@tyrasd tyrasd mentioned this pull request Nov 21, 2014
14 tasks
@tyrasd
Copy link
Owner

tyrasd commented Nov 21, 2014

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.)
Awesome. This looks very promising, thanks you. I only think that the usefulness of this feature highly depends on implementing mapcss layers (#118) also.

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.)

@sanderd17
Copy link
Contributor Author

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).

@tyrasd tyrasd merged commit aa5e661 into tyrasd:master Nov 21, 2014
@mmd-osm
Copy link
Contributor

mmd-osm commented Nov 22, 2014

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?

icn

@tyrasd
Copy link
Owner

tyrasd commented Nov 22, 2014

//cc @bbecquet: Has this to do with bbecquet/Leaflet.PolylineOffset#1 maybe?

@sanderd17
Copy link
Contributor Author

@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).

@yopaseopor
Copy link

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.
Now you can't with http://overpass-turbo.eu/s/qj5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants