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.

onRegionIsChanging is not working on Android.

See original GitHub issue

The onRegionIsChanging event is not working for me in android. I am trying to call onRegionIsChanging to get the heading value but it gets called only when the compass heading is zero. For ios, there is no issue.

 <MapboxGL.MapView
          onRegionIsChanging={this.onRegionIsChanging}
          onRegionDidChange={this.onRegionDidChange}
          ref={c => (this._map = c)}
          onPress={this.onPress}
          style={{ flex: 1 }}
        >
          <MapboxGL.Camera
            zoomLevel={9}
            centerCoordinate={[-73.970895, 40.723279]}
          />
        </MapboxGL.MapView>

 onRegionIsChanging() {
    const map = await this._map;
    console.log(
      "onRegionIsChanging event",
      map.state.region.properties.heading
    );
  }
   "@react-native-mapbox-gl/maps": "^7.0.1",
   "react-native": "^0.59.9"

I am trying to get heading value from onRegionIsChanging event (event.properties.heading ). Is there a way to get the heading value as the user rotates/moves the chart?

To Reproduce checkout my repo in that I have used the GetZoom example(search for GetZoom.js).It also presents in the mapbox gl example code.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
frankrowecommented, Sep 4, 2019

@kristfal I’m not 100% sure what the difference is. I will make a PR and let folks test it out

0reactions
kristfalcommented, Sep 5, 2019

Prior the callback would only fire on programmatic events. Now they also fire on user gestures.

Read more comments on GitHub >

github_iconTop Results From Across the Web

onRegionIsChanging is not working on Android. #323 - GitHub
I am trying to call onRegionIsChanging to get the heading value but it gets called only when the compass heading is zero. For...
Read more >
react native - Mapbox - Map loads on iOS but not on Android
Now this map loads on iOS but not on Android. This is the code <MapboxGL.MapView style={editStyles.map} onRegionIsChanging={(features) ...
Read more >
rnmapbox/Lobby - Gitter
I'm trying to use rnmapbox/maps library with the latest React Native (0.70.x) and it doesn't seem to work. Is this expected/has anyone been...
Read more >
How to use the Mapbox SDK to render custom tiles
first you are going to download/add your tileset into your app, if you download it on runtime I strongly advice for you to...
Read more >
mapbox - Bountysource
on iOS it works fine. but in android, the arrow doesn't move when I change the phone ... https://github.com/react-native-mapbox-gl/maps/issues/1420.
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