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

[CRITICAL!] Incorrect corridor width #7

Open
kurenai-11 opened this issue Nov 1, 2023 · 0 comments
Open

[CRITICAL!] Incorrect corridor width #7

kurenai-11 opened this issue Nov 1, 2023 · 0 comments

Comments

@kurenai-11
Copy link

kurenai-11 commented Nov 1, 2023

I don't know if I am stupid but I think this library did a critical error.
In the function

_getWeight: function (map, corridor) {
   return corridor * 2 / this._getMetersPerPixel(map);
 },

Corridor in m gets doubled. Why? It makes no sense to me because upon a simple google, svg stroke width, and by extension leaflet polyline stroke weight are representing the STROKE WIDTH.
I guess the error came because @mikhailshilkov thought that it is a circle radius (seeing how default settings have round lines) and we needed its diameter, but it is wrong. Stroke width represents exactly what it says, the actual line thickness. Circles in svg are different entities and they have the radius as a separate parameter.

Solution: remove the * 2.

I am myself too lazy to do a pull request, but wanted to warn someone who might see this someday.

@kurenai-11 kurenai-11 changed the title (CRITICAL!) Incorrect corridor width [CRITICAL!] Incorrect corridor width Nov 1, 2023
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

1 participant