Leaflet: L.Circle: circles with same radius have different sizes with L.CRS.Simple

Created on 19 Oct 2017  路  5Comments  路  Source: Leaflet/Leaflet

How to reproduce

Circles have different sizes even if they have the same radius

After a quick look at the code it seems that the problem is the rounding applied by the latLngToLayerPoint function here https://github.com/Leaflet/Leaflet/blob/703ae02aa8cbd0b87be5b01e77754b83ad732267/src/layer/vector/Circle.js#L97 which produces different radius values depending on the circle coordinates.

Most helpful comment

Ok, lets instead say this is then a duplicate of #4745 and fixed by #4808, which removes the rounding in latLngToLayerPoint :smile:.

All 5 comments

seems to be the same issue described here https://github.com/Leaflet/Leaflet/issues/4582

@danydev well spotted, I'm closing as duplicate of #4582.

After deeper inspection, I'm not sure it's the same exact issue. By looking at the pull request in #4582 I see that the fix is in the code branch for L.CRS.Earth.distance while this bug refers to the L.CRS.Simple, so even if we finalize the proposed fix, we'll not fix this one.
It may be helpful to leave this case open to have feedback for an eventual fix.

This issue refers to L.CRS.Simple so the fix proposed in #4582 won't fix this one.

Ok, lets instead say this is then a duplicate of #4745 and fixed by #4808, which removes the rounding in latLngToLayerPoint :smile:.

Was this page helpful?
0 / 5 - 0 ratings