mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

cameraChanged event needs information on gestures

Open teradyl opened this issue 3 years ago • 0 comments

New Feature

Data about gestures within the cameraChanged event. Specifically

  • Is the camera changing due to current user interaction?
  • Is the camera changing due to previous user interaction that is still in progress animating? (ex: a flick of map)

Why

I'm having problems implementing previous features because of lack of interoperability between the gesture events and the cameraChanged events. I want to reload annotations on the map whenever the map stops moving, but there is no event for that.

gestureManagerDidEnd and didEndAnimationFor do most of the work, but when the camera moves without user interaction or some other camera movement, there is no event. If I add my reload code to the cameraChanged code, it gets called during the entire gesture, which is way too often.

I think the easiest way to fix this is to have some data inside cameraChanged on whether the current camera changes are due to user interaction or not (including the animating when the gesture is no longer currently happening but did just happen and is causing the camera to continue to move)

teradyl avatar Oct 14 '22 22:10 teradyl