-
Notifications
You must be signed in to change notification settings - Fork 1.3k
remove delay argument from notifyMapChange #1026
Comments
This is not a delay; it relates to the animation timeouts used. For example, if Cocoa tells the map to move on a |
For context on the need for these, see callbacks like |
They should be -- that's what I'm suggesting in this issue. But it doesn't look to me like that's the current behavior. See, e.g. mapbox-gl-native/src/mbgl/map/transform.cpp Lines 286 to 289 in b4dbba9
and mapbox-gl-native/platform/ios/MGLMapView.mm Lines 1629 to 1637 in b4dbba9
|
Also mapbox-gl-native/platform/ios/MGLMapView.mm Lines 586 to 598 in b4dbba9
|
It does this because each platform is responsible for the velocity-based deceleration that feels right on that platform, which means differing durations. |
Sure. But the point of this bug is: given an easing operation is started on Make sense? |
Not just the easing duration, but also the timing curve, are done Cocoa-side. This isn't done as an atomic duration on the GL side, but rather a series of sub-durations. mapbox-gl-native/platform/ios/MGLMapView.mm Lines 570 to 584 in b4dbba9
But you only want one notification. I'm not saying this is the best/only way, but giving some context for why it is how it is now and why it might be the only way. |
If this is necessary, then the notifications have to be done entirely Cocoa-side, and the The current behavior is that each call to |
FWIW, I introduced this whole system in order to start tapping into render lifecycle events to an extent that we've not been able to before, in order to get at things like Perhaps using it for viewport changes as well is ill-advised. It's sounding like it. |
From the docs, it doesn't sound to me like this is true. Both
|
I meant one notification in the context of one per set of changes — if you make one move, you may get one notification out of MapKit, but for the equivalent change in GL, you might get a Additionally, our raster SDK improved upon Apple's implementation to make this more reliable for the user, posting only a single We are basically walking a line somewhere between MapKit and up to / ideally including our raster SDK's behavior here. |
I think you meant For an unanimated change:
For an animated change:
|
Yeah, exactly — that flow captures it just right. These are things devs want (in addition to rendering start/finish and user interaction indication, which are out of scope here maybe) in order to sync up other UI elements. |
With #1026 the region delegate methods work reliably and as expected. This commit adds `mapView:regionWillChangeAnimated:`, `mapViewRegionIsChanging:`, and `mapView:regionDidChangeAnimated:` to the official documentation.
With mapbox#1026 the region delegate methods work reliably and as expected. This commit adds `mapView:regionWillChangeAnimated:`, `mapViewRegionIsChanging:`, and `mapView:regionDidChangeAnimated:` to the official documentation.
It shouldn't be the responsibility of the view implementation to set up a timer to resend the notification after a delay -- notifications should just be dispatched at the right time.
The text was updated successfully, but these errors were encountered: