MapView's onUserLocationUpdate doesn't seem to fire
See original GitHub issueDescribe the bug MapView’s onUserLocationUpdate doesn’t seem to fire.
To Reproduce
onUserLocationUpdate = (location) => {
console.log('location',location);
}
render() {
return (
<MapboxGL.MapView
animated
ref={c => this.map = c}
styleURL={this.props.theme.styleURL}
onUserLocationUpdate={this.onUserLocationUpdate}
onPress={this.onPress}
logoEnabled={false}
compassEnabled={false}
pitchEnabled={false}
onRegionWillChange={this.onRegionWillChange}
style={{ flex: 1 }}
onDidFinishLoadingMap={this.onDidFinishLoadingMap}
onDidFinishRenderingMap={this.onDidFinishRenderingMap}
onDidFinishRenderingMapFully={this.onDidFinishRenderingMapFully}
onDidFinishLoadingStyle={this.onDidFinishLoadingStyle}
onUserLocationUpdate={this.onUserLocationUpdate}
>
<MapboxGL.UserLocation visible={true} renderMode="custom">
<MapboxGL.CircleLayer id="mapboxUserLocationPluseCircle" style={layerStyles.normal.pulse} />
<MapboxGL.CircleLayer id="mapboxUserLocationWhiteCircle" style={layerStyles.normal.background} />
<MapboxGL.CircleLayer id="mapboxUserLocationBlueCicle" aboveLayerID="mapboxUserLocationWhiteCircle" style={layerStyles.normal.foreground} />
</MapboxGL.UserLocation>
<MapboxGL.Camera
followUserLocation={this.state.currentTrackingModeIsFollowing}
followUserMode="course"
onUserTrackingModeChange={this.onUserTrackingModeChange}
/>
</MapboxGL.MapView>
)
}
Expected behavior Expected onUserLocationUpdate to fire the callback
Screenshots N/A
Versions (please complete the following information):
- Platfrom: iOS
- Device: iPhone 7 Plus
- OS: iOS 12.3.1.
- SDK Version: N/A
- react-native-mapbox-gl Version: 7.0.0-rc3
- React Native Version 0.56.0
Additional context Just doesn’t seem to fire. I searched the repo’s source code and not sure why it could be not working - seems like onUserLocationUpdate is still a prop of MapView, not Camera. Not quite sure if it’s because of some props i’m passing in. Was working fine 6.1.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:26 (18 by maintainers)
Top Results From Across the Web
MapView's onUserLocationUpdate doesn't seem to fire #246
Describe the bug MapView's onUserLocationUpdate doesn't seem to fire. To Reproduce onUserLocationUpdate = (location) ...
Read more >How to Get User Location on a Map - Swift - YouTube
Head to https://squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
Read more >Notifications when your shared location is updated - Android
On your home screen or app menu, long press the Google Maps app Maps . Then, tap Info. · Tap Notifications. · Scroll...
Read more >Reload My Location button when permission is granted
If location access has already been granted, it works as intended. Whoever if the map is already loaded, the My Location button does...
Read more >How to Tell if Someone Checked Your Location on Snapchat
Snap Map is a Snapchat feature that allows you to view your friends' locations and share yours as well. Sure, that feature sounds...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should create a throttle control for this and onRegionIsChanging similar to ScrollView onScroll. The throttle should happen on native side to prevent unnecessary bridge activity.
Happy to see a PR for this. The RN core ScrollView can be a good source of inspiration for this code.
On Wed, 30 Oct 2019 at 19:39, Richard Lindhout notifications@github.com wrote:
Interestingly I’ve noticed, that it not always fires like crazy, sometimes it’s less frequent, sometimes more… I also only monitor it via remote debugger when in the office.