Comments (6)
@systemlevel with #57 you should be able to declare in any order and RNMapbox should wait for the layer to be inserted bellow.
from maps.
See also nitaliano/react-native-mapbox-gl#1135.
The issue is that at the time #customSourceFill
added to the map, the #aboveLayerID is not yet added to the map therefore it will not find the layer and that's the cause of crash.
Ideally in such cases we'd defer the insertion until the referred layer is added
from maps.
@mfazekas Thank you for that insight. What is the best way to ensure a layer is added to the map? Does the order in which I define the layers have any impact on that order?
For example, if I were to switch these layers around:
<Mapbox.RasterSource id="rasterSourceBasemap" tileSize={256} url={url}>
<Mapbox.RasterLayer
id="basemap"
sourceID="rasterSourceBasemap"
style={{rasterOpacity: 1}}
/>
</Mapbox.RasterSource>
<Mapbox.VectorSource
id="customSourceExample"
url={VECTOR_SOURCE_URL}
>
<Mapbox.FillLayer
id="customSourceFill"
sourceLayerID="roadless"
style={mbStyles.boxFill}
aboveLayerID="basemap"
/>
</Mapbox.VectorSource>
Would that load in the proper order?
from maps.
@systemlevel yep that should work.
from maps.
@mfazekas Excellent update. Thank you. That is perfect!
from maps.
@mfazekas Doing some more testing on this tonight. I'm still having some issues getting the aboveLayerID property working.
Here is some more context:
- We have made a custom style map in mapbox studio
- We have added various vector layers to that mapbox studio map (these are layers we uploaded into studio)
- 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>
from maps.
Related Issues (20)
- [Bug]: Android PointAnnotation callbacks onDrag, onDragStart, and onDragEnd do not fire HOT 3
- iOS Pod error even after following setup HOT 3
- [Bug]: ERROR Mapbox error setWellKnownTileServer is deprecated and will be removed {"level": "error", "message": "setWellKnownTileServer is deprecated and will be removed", "tag": "RNMBXModule"} HOT 1
- [Bug]: ERROR Mapbox error setWellKnownTileServer is deprecated and will be removed {"level": "error", "message": "setWellKnownTileServer is deprecated and will be removed", "tag": "RNMBXModule"} HOT 2
- [Bug]: Broken Camera centerCoordinate HOT 1
- [Bug]: UserLocation & LineLayer disappearing when adding RasterLayer
- [Bug]: Ornament position differs on Android and iOS
- Could not find com.mapbox.maps:android:10.16.4. HOT 6
- [Bug]: PointAnnotation draggable props not working on ios
- [Bug]: Crash on Android with dynamic shape source (Ios works fine), Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR) HOT 8
- > Task :rnmapbox_maps:compileReleaseKotlin FAILED when building apk HOT 2
- [Bug]: Camera.zoomTo not working HOT 5
- [Bug]: `LocationPuck` bearing not visible on Android HOT 1
- [Upstream Bug]: Camera centers incorrectly around bounds with padding HOT 3
- Expo Prebuild Secret Key HOT 4
- Android: When user pitches the map (two finger swipe gesture), isGestureActive becomes false when pitch starts to change
- [Bug]: RNMBXModels.models.getter not implemented (Expo Project) HOT 6
- [Bug]: FillLayer not rendered on IOS HOT 2
- Cannot upload app to app store on iOS HOT 2
- [Bug]: Flyto not working on Android HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maps.