Map style according to state crashes app
See original GitHub issueWhen doing something like this:
style={this.props.mapMode.mapStyle}
and also rendering a Layer with an inline source (Specifically I am using GeoJSONLayer but this happens on all layers)
<GeoJSONLayer data={.... inline source} ....
Everything works fine until the mapStyle changes, then an error is thrown:
Uncaught TypeError: Cannot read property 'setData' of undefined at GeoJSONLayer../node_modules/react-mapbox-gl/lib/geojson-layer.js.GeoJSONLayer.componentWillReceiveProps (geojson-layer.js:128)
Easily reproducible, just change mapstyle while using geojson
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
react-native-maps crash application on provider="google ...
I have an Expo app with react-native-maps and I want to set custom styles to the map like in this thread react-native-maps custom...
Read more >MapView is causing the app to crash. This was not happening ...
I am facing the same problem, my app ( in production ) started crash when opening any view an a map. 1
Read more >How to fix Maps when it crashes - Android - Google Maps Help
If the Google Maps app on your phone or tablet crashes or has other issues that affect your experience on Maps, try the...
Read more >Google Maps is DOWN: Navigation app crashes for frustrated ...
Google Maps is DOWN: Navigation app crashes for frustrated users around the world · According to Down Detector, the issues started at around...
Read more >Untitled map
Outline Map. Firefly Imagery Hybrid. NAIP Imagery Hybrid. USGS National Map. USA Topo Maps. OpenStreetMap (Blueprint). Esri, USGS | Esri, FAO, NOAA, USGS....
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
react-mapbox-gl version 3.4.1 should include this fix. Thanks @sergei-zelinsky for pointing out the issue! 👍
@sergei-zelinsky I must be doing something wrong. I have three seperate maps in my app. It works on one but not on the other 2. Spent a few hours yesterday trying to work it out. If I use the GeoJSONLayer component it works. If I get some time next year I’ll investigate more and see if it’s just me being stupid or if its some weird edge case.