Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

getMapAsync() does not work when offline. #4438

Closed

Description

@vfaSonnt

The function getMapAsync() doesn't work on Fragment and SupportFragment when turn off network.
On activity, it seem to work fine.
Please, have a look at this problem.

Activity

  1. added
    Android
    on Mar 23, 2016
  2. tobrun commented on Mar 23, 2016

    @tobrun
    Member

    Thank you for reaching out and reporting your problem.
    I'm also noticing this without turning off network.
    I already created an issue related to adding a MapView programatically.
    Going to use #4439 in favour of this.

  3. vfaSonnt commented on Mar 24, 2016

    @vfaSonnt
    Author

    @tobrun I add SupportFragment progammatically, and it work fine with the network. I get the source from github and add log at getMapAsync() on example of FragmentActivity and SupportFragmentActivity. When network is on, it work OK. Turning network off, it can not show log.

  4. tobrun commented on Mar 24, 2016

    @tobrun
    Member

    @vfaSonnt thank you clarifying that for me. Besides #4393 there is already a #4393 ticket open that should cover your use-case. You are using the offline functionality and downloaded a region locally?

  5. vfaSonnt commented on Mar 24, 2016

    @vfaSonnt
    Author

    @tobrun No, I test on Mapbox Examples source code with SupportMapFragmentActivity. Network on, it animate Camera, without network , it stay still.

    mapFragment.getMapAsync(new OnMapReadyCallback() {
                @Override
                public void onMapReady(@NonNull MapboxMap mapboxMap) {
                    Log.d(TAG, "Map is ready");
                    mapboxMap.animateCamera(CameraUpdateFactory.zoomBy(2), 3500);
                }
            });
    
  6. tobrun commented on Mar 24, 2016

    @tobrun
    Member

    @vfaSonnt

    I produced this clip with the SupportMapFragmentActivity when I have no internet, IMHO this is working as designed. If there is no internet connection we are not able to load content. If I turn on my WiFi and I have a new connection it downloads the content and calls the onMapReady callback.

    Please elaborate what you expect it should do, I'm open to suggestions.

    https://www.dropbox.com/s/o39dw9s6vhmwehh/device-2016-03-24-102121.mp4?dl=0

  7. vfaSonnt commented on Mar 24, 2016

    @vfaSonnt
    Author

    @tobrun
    Thank you for your support.
    Sorry ,my bad. I didn't tell you about android OS.
    I test on Galaxy S4, OS 4.4.2, this bug will always appear. 100% appear.
    So I think it only happen on Android OS <5.0.

    I test on Nexus5, OS 5.0. It work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions