0.8-dev L.circle with tiny radius renders wrongΒ #2425
Closed
Description
opened on Jan 30, 2014
When creating a circle with a very small radius of 0.01 (m), Leaflet 0.8-dev renders it incorrectly. I tracked this down to the calculation of lngR in L.Circle._project an patched my version to use the old version of this calculation. I have not had a chance to debug the new calculation.
Here is the line and my patch to the old code:
lat2 = map.unproject(p).lat;
//var lngR = latR / Math.cos(Math.PI / 180 * lat); //old way
lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) /
(Math.cos(lat * d) * Math.cos(lat2 * d))) / d;
And here is what it renders like in 0.8-dev:
I am doing testing of hi-precision GPS devices and this is how I test for 'cm' accuracy, so use these tiny radius circles to test results.
Activity