question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onMapIdle and onCameraChanged not called on Android

See original GitHub issue

Describe the bug
the callback supplied to onMapIdle and onCameraChanged is not being called on my Android device, but is on iOS. This is the mirror opposite of this earlier bug I filed https://github.com/rnmapbox/maps/issues/1887

To Reproduce
Steps to reproduce the behavior.

BTW this repro bug templatejs is not public anymore: our BugReportTemplate screens

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapboxGL.MapView
               onMapIdle={()=> console.log("not working on android")}
            >

               <MapboxGL.UserLocation
                  onUpdate={this.onUserLocationUpdated}
               />
               <MapboxGL.Camera
                  zoomLevel={12}
                  animationMode={"flyTo"}
                  centerCoordinate={[0,0]}
               />
            </MapboxGL.MapView>
    );
  }
}

Expected behavior
callback to be called

Actual behavior
callback not calling for Android

Versions (please complete the following information):

  • Platform: Android
  • Platform OS: API 30
  • Device: pixel 5
  • Emulator/ Simulator: yes
  • Dev OS: osx 12.2.1
  • @rnmapbox/maps Version 10.0.0-beta.1
  • Mapbox GL version unknown
  • React Native Version 0.67.2

additinoal info my setup is with mapbox

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
naftalibedercommented, May 14, 2022

value it much more if we can help user migrate their code

Totally fair, I was just prioritizing differently. No need to do a breaking change for these functions

0reactions
naftalibedercommented, May 20, 2022

@1mike12 To be fair, none of the map callbacks had been implemented on iOS for v10 yet - so this wasn’t a breaking change so much as implementing a new feature differently from the documentation. Still - point taken! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android onCameraChange in Fragment is never called
The method onCameraChange, implemented by the Fragment that host the SupportMapFragment, is never called also if I set up all right.
Read more >
[android] Problem with CameraIdleListener · Issue #12260
When I try to pinch to zoom (in/out) OnCameraIdleListener is called multiple times. We tried couple of work arounds such as using 200ms...
Read more >
GoogleMap.OnCameraIdleListener | Google Play services
Called when camera movement has ended, there are no pending animations and the user has stopped interacting with the map. This is called...
Read more >
Fix an installed Android app that isn't working - Google Support
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
Behavior changes: apps targeting API 29+ - Android Developers
If you will not be targeting Android 10 (API level 29), some of these changes ... This change increases security and robustness when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found