flutter_map
flutter_map copied to clipboard
[BUG] Spam pinch zoom in and out V5
What is the bug?
When you spam pinching zoom in and out and at the end i get this error:
The following assertion was thrown while handling a gesture:
'package:latlong2/latlong/LatLng.dart': Failed assertion: line 33 pos 16: 'latitude >= -90 && latitude <= 90': is not true.
package:latlong2/latlong/LatLng.dart:33
When the exception was thrown, this was the stack
#2 new LatLng
package:latlong2/latlong/LatLng.dart:33
#3 SphericalMercator.unproject
package:flutter_map/…/geo/crs.dart:398
#4 Crs.pointToLatLng
package:flutter_map/…/geo/crs.dart:37
#5 FlutterMapState.unproject
package:flutter_map/…/map/state.dart:555
#6 MapGestureMixin._offsetToCrs
package:flutter_map/…/gestures/gestures.dart:655
#7 MapGestureMixin.handleScaleUpdate
package:flutter_map/…/gestures/gestures.dart:440
#8 ScaleGestureRecognizer._advanceStateMachine.<anonymous closure>
package:flutter/…/gestures/scale.dart:702
#9 GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:275
#10 ScaleGestureRecognizer._advanceStateMachine
package:flutter/…/gestures/scale.dart:701
#11 ScaleGestureRecognizer.handleEvent
package:flutter/…/gestures/scale.dart:553
#12 PointerRouter._dispatch
package:flutter/…/gestures/pointer_router.dart:98
#13 PointerRouter._dispatchEventToRoutes.<anonymous closure>
package:flutter/…/gestures/pointer_router.dart:143
#14 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
#15 PointerRouter._dispatchEventToRoutes
package:flutter/…/gestures/pointer_router.dart:141
#16 PointerRouter.route
package:flutter/…/gestures/pointer_router.dart:127
#17 GestureBinding.handleEvent
package:flutter/…/gestures/binding.dart:488
#18 GestureBinding.dispatchEvent
package:flutter/…/gestures/binding.dart:468
#19 RendererBinding.dispatchEvent
package:flutter/…/rendering/binding.dart:333
#20 GestureBinding._handlePointerEventImmediately
package:flutter/…/gestures/binding.dart:413
#21 GestureBinding.handlePointerEvent
package:flutter/…/gestures/binding.dart:376
#22 GestureBinding._flushPointerEventQueue
package:flutter/…/gestures/binding.dart:323
#23 GestureBinding._handlePointerDataPacket
package:flutter/…/gestures/binding.dart:292
#27 _invoke1 (dart:ui/hooks.dart:188:10)
#28 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:424:7)
#29 _dispatchPointerDataPacket (dart:ui/hooks.dart:119:31)
(elided 5 frames from class _AssertionError and dart:async)
Handler: "onUpdate"
Recognizer: ScaleGestureRecognizer#4d903
debugOwner: FlutterMapState#8fff9(tickers: tracking 2 tickers)
How can we reproduce it?
When you spam pinching zoom in and out
Do you have a potential solution?
No response
Platforms
Samsung Galaxy S21 (Android 12)
Severity
Minimum: Allows normal functioning
Hi @robpot95, what version are you using?
At the moment i'm using v5, due to issues with v6
Also notice somtimes i could get Infinity to NaN which cause the app freeze
We're unable to provide much support for bugs like this in older versions, but we'll keep it open for now. Thanks for reporting!
I understand, but can it be avoided until i can uppgradera to v6. Also i have no idea if this bug is in v6
Unfortunately it probably can't be avoided, as it's a bug in the internals. Not sure if it's in V6 either, but there is a gesture rewrite on the way at some point soon, so hopefully that should help.
This is an issue with latlong2. it asserts that lat, lon objects are within +-90, +-180. which is causing the crash. potentially there is also still an issue with the gesture system too but #1750 (or a fix upstream) might fix the issue
I would imagine we're not applying the extremity constraints correctly or something, and when a frame is skipped, it doesn't do the check? Or something like that maybe?
Closing this for now. If this needs re-opening, please ping me!