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.

Mapbox crashes when using "aboveLayerID" property

See original GitHub issue

Describe the bug Mapbox crashes when using “aboveLayerID” property.

To Reproduce

Add various layers and set one of the layers to appear “above” the other as follows:

        <Mapbox.VectorSource
          id="customSourceExample"
          url={VECTOR_SOURCE_URL}
        >
          <Mapbox.FillLayer
            id="customSourceFill"
            sourceLayerID="roadless"
            style={mbStyles.boxFill}
            aboveLayerID="basemap"
          />
        </Mapbox.VectorSource>


       <Mapbox.RasterSource id="rasterSourceBasemap" tileSize={256} url={url}>
          <Mapbox.RasterLayer
            id="basemap"
            sourceID="rasterSourceBasemap"
            style={{rasterOpacity: 1}}
          />
        </Mapbox.RasterSource>

Expected behavior In the above example, the Vector FillLayer should appear above the RasterLayer based on the property defined aboveLayerID=“basemap”

Screenshots xCode crashes:

Screen Shot 2019-05-18 at 10 56 49 PM

Versions (please complete the following information):

  • Platfrom: iOS
  • Device: XR Simulator
  • React Native Version 0.59

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mfazekascommented, May 24, 2019

@systemlevel with #57 you should be able to declare in any order and RNMapbox should wait for the layer to be inserted bellow.

0reactions
systemlevelcommented, May 30, 2019

@mfazekas Doing some more testing on this tonight. I’m still having some issues getting the aboveLayerID property working.

Here is some more context:

  1. We have made a custom style map in mapbox studio
  2. We have added various vector layers to that mapbox studio map (these are layers we uploaded into studio)
  3. When I try to order those layers in the react-native-mapbox-gl client they don’t seem to respond to the order I try to define whether it be via aboveLayerID or layerIndex.

I’m able to control the visibility but I’m unable to control where they sit in relation to the RasterSource layer:

       <Mapbox.RasterSource id="rasterSourceBasemap" tileSize={256} url={url}>
          <Mapbox.RasterLayer
            id="basemap"
            sourceID="rasterSourceBasemap"
            style={{rasterOpacity: 1}}
          />
        </Mapbox.RasterSource>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mapbox crashes when using "aboveLayerID" property #52
Describe the bug Mapbox crashes when using "aboveLayerID" property. To Reproduce Add various layers and set one of the layers to appear ...
Read more >
rnmapbox/Lobby - Gitter
I'm fighting with a crash react-native application on unblocking iPhone which is somehow connected with react-native-mapbox-gl module.
Read more >
React native mapbox-gl crashes with react-navigation
My solution was to render map only when modal is expanded. So I made a conditional rendering. Checked whether modal is shrinked or...
Read more >
changelog - CocoaPods
(#9865); Fixed an issue that could cause a crash when using -[MGLMapView ... localizesLabels property, off by default, that localizes any Mapbox ......
Read more >
A Mapbox GL react native module for creating custom maps
Implement react-native-mapbox-gl with how-to, Q&A, fixes, code snippets. kandi ... 'mapbox' // Use the secret token you stored in gradle.properties as the ...
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