Open Stan92 opened 7 years ago
Are you using Leaflet 1.0.x or 1.1.x?
I simply use the online demo I ve changed the code by adding parseFloat(n).toFixed...
I'm getting the same error too using Leaflet 1.0.3 and Leaflet Draw 0.4.10.
Yup, got the same error. Looking into it.
I am too. It happen in my chrome console while I draw a circle.
same issue here!. also Only happens to me if zoom more than 14 :(
+1
PR is up
Solved extending String class methods to handle toFixed method also withstring variables, with this code to :
if (!String.toFixed) {
String.prototype.toFixed = function (decimals) {
return parseFloat(this.toString()).toFixed(decimals);
}
};
@manolino I'd be hesitant to extend built-in JS functions in a publicly available npm package. What if other authors decide to do the same and someone ends up needing to use Leaflet.draw and some other package that also provides a definition for String.toFixed? Could lead to some frustration for some devs.
I see this bug as well, the PR #747 fixes it completely
I'm assuming this will make 0.4.11 - just fyi - we get this with leaflet 1.0.3 and 1.2.0 and are staying with 0.4.9 until resolved
I'm using the Leaflet draw 0.4.10 and Leaflet 1.0.3 and this problem happen with me, when I will use the circle the app crash, what can I do? @sgentile
Go back to version 0.4.9 worked for me
On Aug 9, 2017 10:23 AM, "Victor Magalhães" notifications@github.com wrote:
I'm using the Leaflet draw 0.4.10 and Leaflet 1.0.3 and this problem happen with me, when I will use the circle the app crash, what can I do? @sgentile https://github.com/sgentile
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Leaflet/Leaflet.draw/issues/741#issuecomment-321270670, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIFNBh2VdFJd-iOItteEf00qtGLydDbks5sWcDjgaJpZM4OKL3K .
Yeh @sgentile I do this, worked for me too. thx
How to reproduce
Hi, Using the example, when I start drawing a circle object, I get this following error.
GeometryUtil.js:45 Uncaught TypeError: n.toFixed is not a function at Object.formattedNumber (GeometryUtil.js:45) at Object.readableDistance (GeometryUtil.js:130) at NewClass._onMouseMove (Draw.Circle.js:68) at NewClass.fire (Events.js:186) at NewClass._touchEvent (TouchEvents.js:78) at NewClass._onTouchMove (TouchEvents.js:151) at handler (DomEvent.js:72) at Object._handlePointer (DomEvent.Pointer.js:107) at Object. (DomEvent.Pointer.js:115)