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.

Map style according to state crashes app

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alex3165commented, Dec 21, 2017

react-mapbox-gl version 3.4.1 should include this fix. Thanks @sergei-zelinsky for pointing out the issue! 👍

0reactions
4xDMGcommented, Dec 23, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

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