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

Side of the offset #5

Closed
sanderd17 opened this issue Nov 21, 2014 · 1 comment
Closed

Side of the offset #5

sanderd17 opened this issue Nov 21, 2014 · 1 comment

Comments

@sanderd17
Copy link
Contributor

I noticed that the JOSM MapCSS implementation uses positive=left and negative=right offset (see https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation#Linestyles)

I noticed your library uses the opposite definition. When I look at it logically, I'd also take your approach. But JOSM approach already has many styles that use it (and already exists 3 years https://josm.openstreetmap.de/changeset/4316/josm).

I'd like to use your code in overpass-turbo (see tyrasd/overpass-turbo#117) to interpret MapCSS. The side of the offset is not a big problem (just add a '-' on the parsing side). But code is always cleaner without unnecessary negations (and the difference may lead to more problems outside this MapCSS library).

So I wonder if you're planning to change the offset side, or if your side is permanant, and we should adapt it in the MapCSS parsing. (In the latter case, it might be worth to document the difference clearly.)

Regards,
Sander

@bbecquet
Copy link
Owner

Sorry, I don't intend to change the offset side. As I built this plug-in from scratch, I decided to go the "Leaflet way": the most intuitive and simple.

Like you, I find the side of MapCSS quite counter-intuitive, and I don't think it's an established-enough format (outside of JOSM) that should absolutely be followed. Actually, looking for similar implementations, I've seen both ways. For example in the Mapserver doc:

A positive x shifts the line to the right when seen along the direction of the line. A negative x shifts the line to the left when seen along the direction of the line.

I hope it's not too cumbersome for your own project. And you're right, I will make it clearer in the readme which side the sign of the value means.

Regards,
Benjamin

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

No branches or pull requests

2 participants