mapbox-gl-native
mapbox-gl-native copied to clipboard
'mapViewDidFinishLoadingMap' method is not called when app is in offline.
Steps to reproduce
- Create an app and download the offline packs.
- Open the app in offline mode.
-
mapViewDidFinishLoadingMap
delegate method is not getting called.
Expected behavior
-
mapViewDidFinishLoadingMap
method should be called when map view finishes loading.
Actual behavior
- But, it's not.
Configuration
Mapbox SDK versions: 4.7.0 iOS/macOS versions: 12.1 Device/simulator models: all Xcode version: 10.1
Hello, Did this issue is even considered or not?
On Android this callback/delegate is correctly called. Can someone from @mapbox/maps-ios look into reproducing this issue?
@ThiyagarajanShivSankaran thanks for your patience, we are currently investigating this issue and believe we have re-created your scenario.
Experiencing the same behaviour.
After some more testing, I was also able to reproduce on android. The callback delegate isn't called when your initial camera position doesn't fully cover the bounds of the offline region (or even slightly more). This makes sense to some degree as tiles in the vicinity aren't fully loaded thus we aren't emitting the fully loaded event neither.
cc @tmpsantos
@tobrun do you get a onDidBecomeIdle
in this case?
Same issue, workaround to solve?
@tmpsantos I don't think there's anything for iOS/Android to do here, can core take a look?
@tmpsantos I'm not getting those either, only when fully covering the region it emits idle/fully loaded
@tmpsantos I don't think there's anything for iOS/Android to do here, can core take a look?
:+1:
Can I know why it's taking so long to fix this issue.
@tmpsantos @pozdnyakov was there any action to take here?
Hi Guys, @tmpsantos @pozdnyakov
Any updates for this issue? Seems there is no update for almost 3 months. We forced to use ugly workarounds due to this bug.
Still have a that issue. Please fix
Hi all, thanks for the feedback. We'll do our best to prioritise this issue. May I ask, what do you use mapViewDidFinishLoadingMap
for in your implementation? I'm hoping to get a sense of your use case.
@arthopar @david-var @ThiyagarajanShivSankaran @mannycalavera27 @alexbtlv
Hi all, thanks for fast reply. We are using mapViewDidFinishLoadingMap to access style and draw layers, because before of mapViewDidFinishLoadingMap the style is nil. We are going to support offline mode for our application, but in offline mode because of this issue, we are unable to determine when we can draw layers. We had done some workaround. we are waiting 1 second and then drawing the layer, but if you have other solution I will glad to know.
Regards, Artak
On Sat, Dec 14, 2019 at 5:58 AM Chloe Krawczyk [email protected] wrote:
Hi all, thanks for the feedback. We'll do our best to prioritise this issue. May I ask, what do you use mapViewDidFinishLoadingMap for in your implementation? I'm hoping to get a sense of your use case.
@arthopar https://github.com/arthopar @david-var https://github.com/david-var @ThiyagarajanShivSankaran https://github.com/ThiyagarajanShivSankaran @mannycalavera27 https://github.com/mannycalavera27 @alexbtlv https://github.com/alexbtlv
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-gl-native/issues/13867?email_source=notifications&email_token=ABGVBY7UO77TSQBKEWTD6BDQYQ4UJA5CNFSM4GUDAJZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG3XCQQ#issuecomment-565670210, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGVBY4HUZBFGWHKURVFFTTQYQ4UJANCNFSM4GUDAJZA .
-- Regards, Artak Tsatinyan
We are using mapViewDidFinishLoadingMap to access style and draw layers because before of mapViewDidFinishLoadingMap the style is nil.
@arthopar Have you tried using Android MapView.addOnDidFinishLoadingStyleListener
or iOS mapViewDidFinishLoadingStyle
? After that callback is invoked, style should not be nil
.
From https://github.com/mapbox/mapbox-gl-native/issues/13867#issuecomment-472335865
The callback delegate isn't called when your initial camera position doesn't fully cover the bounds of the offline region (or even slightly more). This makes sense to some degree as tiles in the vicinity aren't fully loaded thus we aren't emitting the fully loaded event neither.
I'm having the same results and to put it in a different way: I see that mapViewDidFinishLoadingMap
is invoked if the camera fully covers the loaded region - it is expected behavior: mapViewDidFinishLoadingMap
cannot be invoked until all the requested tiles are loaded i.e. if the engine has requested any tiles that are not present in the offline region.
My recommendation would be either using mapViewDidFinishLoadingStyle
or making sure that the offline region contains all the tiles requested for the app work.
Another important thing might be turning off the tile pre-fetch (shall not be needed in pure offline mode), so that the engine does not request lower zoom level tiles.
Alexander, thanks I guess we can use mapViewDidFinishLoadingStyle, but Is it secure to set camera in that stage, or download offline pack?
On Mon, Dec 16, 2019 at 2:56 PM Mikhail Pozdnyakov [email protected] wrote:
From #13867 (comment) https://github.com/mapbox/mapbox-gl-native/issues/13867#issuecomment-472335865
The callback delegate isn't called when your initial camera position doesn't fully cover the bounds of the offline region (or even slightly more). This makes sense to some degree as tiles in the vicinity aren't fully loaded thus we aren't emitting the fully loaded event neither.
I'm having the same results and to put it in a different way: I see that mapViewDidFinishLoadingMap is invoked if the camera fully covers the loaded region - it is expected behavior: mapViewDidFinishLoadingMap cannot be invoked until all the requested tiles are loaded i.e. if the engine has requested any tiles that are not present in the offline region.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-gl-native/issues/13867?email_source=notifications&email_token=ABGVBY4KRXAC67OIVQKZ35DQY5NHNA5CNFSM4GUDAJZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG6KIBQ#issuecomment-566010886, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGVBY6O3OG2MLNP76QWNETQY5NHNANCNFSM4GUDAJZA .
-- Regards, Artak Tsatinyan
but Is it secure to set camera in that stage, or download offline pack?
Yeah, I do not think the engine is limiting this.