-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Region change notifications should include camera delta #4384
Comments
Do we know that a round trip to mbgl to convert from geographic coordinates to screen points would actually be a performance issue? |
The concern with summation of deltas is that it is subject to drift due to accumulated imprecision. |
A more direct way of getting what we need for view-based annotations would be to proactively send the screen coordinates of on-screen annotations on RegionDidChange and RegionIsChanging. But I suggested a delta because sending the screen coordinates for all the relevant annotations on each RegionIsChanging sounded like a performance hit. |
Along these lines, it may be useful to allow an |
Filed #4694 for automatically getting annotations in the new viewport. |
Deferring to ios-v3.4.0 because we aren’t comfortable with making the necessary mbgl changes this close to a release. |
With #8377 we have now means of passing additional information (such as However, Changing this behavior implies in modifying our Map API to add a specific getter/setter pair for the edge insets and thus removing it from function calls such as /cc @1ec5 @jfirebaugh |
Note that this issue originally requested the previous camera or a delta from the previous camera, not the current camera, which the SDK code can easily obtain from the map.
I still think it’s appropriate that, from mbgl’s perspective, the map has no intrinsic padding. The iOS SDK, for example, takes advantage of this fact to allow for different paddings simultaneously: one that affects the |
Yes, though I agree with @jfirebaugh that dealing with deltas on core side can cause precision loss. To avoid that, the delta could be calculated from client side - we could e.g. add a |
Actually, I’m less sure that we need camera deltas at all, given the discussion above and the way #2457 was implemented. What’s most important for public notifications is indicating the final camera at the beginning of an animation. The initial camera at the beginning of an animation could be helpful, too, but the SDK can already provide this information by capturing the camera ahead of time. |
@1ec5 Can you open a fresh ticket for that? Closing here since it sounds like we have consensus that deltas aren't necessary. |
The saga continues in #8499. |
Calls to
mbgl::View::notifyMapChange()
should include a “camera delta” struct alongside thembgl::MapChange
that indicates how far the camera has moved in each degree of freedom.The delta would allow the “should change” delegate callback in #2457 to provide enough context for the delegate to make an intelligent decision. It would also allow us to implement view-based annotations (#1784) without requiring a round trip to mbgl to convert from geographic coordinates to screen points. (This would be much more of a performance issue on Android due to JNI round tripping.)
/cc @tobrun @friedbunny @brunoabinader
The text was updated successfully, but these errors were encountered: