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.

OnMapReadyCallback not called #4439

Closed
Closed

Description

@tobrun
        mapView = new MapView(this, options);
        ViewGroup viewGroup = (ViewGroup) findViewById(R.id.parentLayout);
        viewGroup.addView(mapView);

        mapView.onCreate(savedInstanceState);
        mapView.getMapAsync(this);

When creating a mapview as shown above, I'm not receiving the map async callback.
Only when I zoom out a bit I'm receiving the callback.

An example, the maps is shown but callback is not invoked:

device-2016-03-23-113451

Only when you interact (zoom/pan) with the map, the callback is invoked and content is shown:

device-2016-03-23-113538

We need some kind of invalidation or some sort in onStart/onResume to trigger the update?

Activity

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

    @tobrun
    MemberAuthor
  3. tobrun commented on Mar 23, 2016

    @tobrun
    MemberAuthor

    Noticing that this is also true for MapFragment, which makes it more important to fix for 4.0.0

    Update now also noticing this with Activity, all getMapAsync calls are affected.

  4. tobrun commented on Mar 23, 2016

    @tobrun
    MemberAuthor

    This is a bit strange because the configuration currently setup for MapFragmentActivity works as designed, but others don't...

    Update when I call a method that invalidates the map this issue is resolved.

  5. added this to the android-v4.0.0 milestone on Mar 23, 2016
  6. changed the title [-]OnMapReadyCallback not called when creating MapView programatically[/-] [+]OnMapReadyCallback not called[/+] on Mar 23, 2016
  7. tobrun commented on Mar 23, 2016

    @tobrun
    MemberAuthor

    To make it a bit more visual, here is a clip showing the problem:

    As you can see we are not receiving a map fully loaded event until we load a new content by zoom/pan. (when the polylines with markers show up, than we received that callback).

    This is events we receive when just open the screen without interaction:

    CHANGE _0  -> REGION_WILL_CHANGE
    CHANGE _3  -> REGION_DID_CHANGE
    CHANGE _5  -> WILL_START_LOADING_MAP
    CHANGE _0  -> REGION_WILL_CHANGE
    CHANGE _3  -> REGION_DID_CHANGE
    CHANGE _11 -> WILL_START_RENDERING_MAP
    CHANGE _8  -> WILL_START_RENDERING_FRAME
    CHANGE _9  -> DID_FINISH_RENDERING_FRAME
    CHANGE _8  -> WILL_START_RENDERING_FRAME
    CHANGE _9  -> DID_FINISH_RENDERING_FRAME
    CHANGE _8  -> WILL_START_RENDERING_FRAME
    CHANGE _9  -> DID_FINISH_RENDERING_FRAME
    CHANGE _8  -> WILL_START_RENDERING_FRAME
    CHANGE _9  -> DID_FINISH_RENDERING_FRAME

    We are never receiving:

    CHANGE _13  -> DID_FINISH_RENDERING_MAP_FULLY_RENDERED

    The getMapAsync relies on that event before passing control to the end developer.

  8. tobrun commented on Mar 23, 2016

    @tobrun
    MemberAuthor

    Note that I'm able to reproduce this on master, but trying and failing to do this on our release branch. Users have reported this was an issue with the snapshot and snapshots are currently build from release branch..

  9. tobrun commented on Mar 23, 2016

    @tobrun
    MemberAuthor

    I was able to create a clear video of the issue:

    https://www.dropbox.com/s/md7berelecklw2b/device-2016-03-23-220634.mp4?dl=0

    First attempt was a works as designed, second attempt is not rendering all the things needed and thus not giving us the callback we need. You can clearly see that the first attempt did render the name Washington, second attempt didn't.

    Update a small part of the video was missing at the end.
    the markers and routes were shown afterwards.

  10. tobrun commented on Mar 24, 2016

    @tobrun
    MemberAuthor

    I found out this is only producible on Master and that I thought were related isssues are actually not. Removing this from milestone 4.0.0.

    @brunoabinader would you be able to look into this? I think it's related to on of the refactors that happened after branching away from master for release-ios-3.2.0-android-4.0.0

  11. tobrun commented on Mar 24, 2016

    @tobrun
    MemberAuthor

    We were able to git bisect the issue to:

    git bisect bad
    cd1a06c2dc209da81b3d745c088e568b3b14809f is the first bad commit
    commit cd1a06c2dc209da81b3d745c088e568b3b14809f
    Author: Bruno de Oliveira Abinader <[email protected]>
    Date:   Fri Mar 11 14:57:12 2016 +0200
    
        [core] Get rid of MapData::{get,set}animationTime
    
    :040000 040000 efe082eda3375b2fa6e0fe6848ab4bd8f1b135ba c4f8b9da6827cf7425a4ca5b7fbec74074597765 M  src
    :040000 040000 97e27d17a2390e96f96f959a5c5d5eb76e98abd1 cf7fb350ccb2d52a54d956f42c16bdce366e0d15 M  test
    
  12. LouisCAD commented on Mar 9, 2018

    @LouisCAD

    I'm getting this issue in version 5.4.0 using SupportMapFragment in an Activity. What is even more weird is that it works consistently in another Activity, and consistently doesn't work in the one experiencing the bug

  13. LouisCAD commented on Mar 9, 2018

    @LouisCAD

    This seems to happen when the visibility of the container of the SupportMapFragment is set to View.GONE.

  14. zugaldia commented on Mar 9, 2018

    @zugaldia
    Member

    @LouisCAD this problem was present in v4.x, could you cut a separate ticket to track your issue? Thanks!

  15. tobrun commented on Mar 9, 2018

    @tobrun
    MemberAuthor

    @LouisCAD starting of 5.2.0 we need to the hosting view to be measured before we start loading the map resources and thus invoking the OnMapReady callback. This is expected behaviour.

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

    Androidbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions