iOS crash when adding a HeatmapLayer
See original GitHub issueDescribe the bug
This library appears to crash on iOS any time there is a HeatmapLayer in a map.
To Reproduce
Add any HeatmapLayer
to a map and react-native run-ios
. The app will crash
I have created a minimal repository that causes the crash on iOS. https://github.com/zholmes1/MapboxHeatmapExample
Example:
import React, {Component} from 'react';
import {StyleSheet, View} from 'react-native';
import MapboxGL from '@react-native-mapbox-gl/maps';
MapboxGL.setAccessToken('YOUR-ACCESS-TOKEN');
const styles = StyleSheet.create({
page: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
container: {
height: 300,
width: 300,
backgroundColor: 'tomato',
},
map: {
flex: 1,
},
});
export default class App extends Component {
componentDidMount() {
MapboxGL.setTelemetryEnabled(false);
}
render() {
return (
<View style={styles.page}>
<View style={styles.container}>
<MapboxGL.MapView style={styles.map}>
<MapboxGL.VectorSource
id="occurrence"
tileUrlTemplates={[
`https://api.gbif.org/v2/map/occurrence/density/{z}/{x}/{y}.mvt?taxonKey=8671098`,
]}>
<MapboxGL.HeatmapLayer
id="occurrence"
sourceID="occurrence"
sourceLayerID="occurrence"
style={{
heatmapOpacity: 0.5,
heatmapRadius: [
'interpolate',
['linear'],
['zoom'],
0,
2,
9,
20,
],
}}
/>
</MapboxGL.VectorSource>
</MapboxGL.MapView>
</View>
</View>
);
}
}
Expected behavior
HeatmapLayer works properly on iOS
Actual behavior
App hard crashes
Versions (please complete the following information):
- Platform: iOS
- Platform OS: 14.1
- Device: iPhone 11
- Emulator/ Simulator: Both
- Dev OS: macOS 11.1
- react-native-mapbox-gl Version: 8.1.0
- React Native Version: 0.63.4
Other
It appears this crash was documented in 2019 in the mapbox-gl-native
repository. There was a merged into that repository that was meant to fix this crash. https://github.com/mapbox/mapbox-gl-native/issues/14807
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top Results From Across the Web
iOS crash when adding a HeatmapLayer · Issue #1211 - GitHub
Describe the bug This library appears to crash on iOS any time there is a HeatmapLayer in a map. To Reproduce Add any...
Read more >iOS 13 crash on MapKit at -[MKTile… | Apple Developer Forums
I am adding the overlay async, so this is not the cause for the crash. What I know so far is that the...
Read more >Heatmap in Google Maps SDK for iOS - Stack Overflow
Heatmaps don't appear to be supported by the iOS SDK. However, you could try something like LFHeatMap which allows you to generate a...
Read more >Crash Heat Map
Date: 1/17/2020. Locations are approximate. Data Source: TxDOT Crash Records Information System Query. W. Division St.
Read more >[Solved]-Google Maps iOS + Storyboard + Segue = Crash
To stop it from crashing, you need to use the main thread instead. Wrap your performSegueWithIdentifier:sender: as follows to use the main thread:...
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 Free
Top 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
@zholmes1 , btw, I’ve found what’s causing the warning - it’s based on a change introduced by the upstream SDKs: ios / android
It’s annoying, however I think it’s save to ignore
Okay great! Thanks for the quick resolution to this. I’ll leave it up to you whether this issue should be closed or not. It will take care of itself whenever this repo updates to the 6.3 iOS SDK.