Closed FrederickEngelhardt closed 1 year ago
@FrederickEngelhardt thanks for the report, can you try with changing the surfaceView attribute?! It's default was changed in v10: https://github.com/rnmapbox/maps/blob/main/docs/MapView.md#surfaceview
I think that fixed it for this example.
Another thing to mention (related to android and view layers) is that things like react-native-view-shot are not able to capture a screenshot of both maps. Its the highest level map that win in these instances.
import { captureRef } from 'react-native-view-shot'
And using a View ref that wraps both Maps will only show the Top one.
Library: https://github.com/gre/react-native-view-shot
Noting that even the captureScreen method does not work in this case.
@FrederickEngelhardt Sorry I'm not sure if it's an issue with rnmapbox or limitation of rn view-shot
I think it related to view-shot. Thanks for closing this.
Just following up here:
Solution:
Mapbox Implementation
Mapbox
Mapbox Version
10.13.1 (iOS), 10.13.0 android
Platform
Android
@rnmapbox/maps
version10.0.6
Standalone component to reproduce
Observed behavior and steps to reproduce
On v9 with android the layers do no break out of react-native's overflow hidden.
Steps to reproduce
Expected behavior
Android and iOS map overlays should behave the same and both respect overflow: "hidden" view property to allow clipping the Map.
Android overlay does not clip views but iOS does in the v10 implementation.
Notes / preliminary analysis
I have not dived into the native code yet for android, but I have troubleshooted some alternatives.
If you need two maps and them to sync 1:1 and cannot do absolute overlaying
This seems a bit contrived and also would require branching android and ios code so hopefully overflow: 'hidden' properties can be fixed on v10.
Additional links and references
Related react-native commit that adds overflow native support. https://github.com/facebook/react-native/commit/b81c8b51fc6fe3c2dece72e3fe500e175613c5d4