-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make iOS delegate notifications consistent with MapKit #2775
Comments
For Android, the main concern is the loading/failed loading events are the only way to return an error about loading the style to the app since everything is async. @friedbunny How does iOS return async style load failures? |
We could also potentially use |
As for async style load failures, both iOS and Android are going to implement proper C++ exception handling for this in #2825 |
This attempts to make use of the map delegate to determine when a tile is rendered, but due to mapbox/mapbox-gl-native#2775 we sometimes have to give things a shove as not all notifications fire.
#4527 proposes an additional mbgl notification for when the style has finished loading that could be useful for MGLMapViewDelegate. |
It also appears the order in which For example, I show a UICollectionView when an annotation is tapped and hide it when a user taps on an empty area of the map. To accomplish this, I start a timer in |
Actually, it looks like update code called from my implementation of |
It looks like one of these two cases are causing
When tapping on an annotation that is in the center of the screen, and remains there throughout the region change, the annotation is still deselected. I'm not sure if the viewport check or callout deselection is being incorrectly triggered. I attempted to set a flag in my delegate to ignore the deselection callback when the region is changing, but deselection occurs before |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
MapKit
loading
delegate callbacks are exclusively about fetching map data, whilerendering
ones are exclusively the drawing of the map.The flow for Mapkit looks like this on initialization:
Panning around continues to issue the same notification flow.
We don't follow MapKit conventions currently. Instead, at the core-level:
MapChangeWillStartLoading
notifications are fired when the style is setMapChangeDidFinishLoading
is fired after the map is fully rendered, inMap::renderSync()
, not at the point where data is finished loadingMapChangeWillStartRendering
is sent inMap::renderSync()
but only initially (it should always come beforeDidFinish
, but it does not)MapChangeDidFinishRenderingMapFullyRendered
is sent when rendering is doneMapChangeDidFailLoadingMap
is not implemented (Implement MapChangeDidFailLoadingMap event notification #2762)Our initialization flow looks like:
Panning around our map subsequently only sends more
DidFinishRenderingMap
, nothing else.Making our iOS map delegate notifications consistent with MapKit will require core changes, rather than iOS changes, which will in turn affect Android. Should Android follow these conventions, too?
/cc @mapbox/mobile
The text was updated successfully, but these errors were encountered: