-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[android] Fragment add two map and second map is being transparent #7887
Comments
@Vacxe what you are noticing is a result of using a SurfaceView:
This explains the issue a bit as the surfaces behind the Activity window are in front of each other and this isn't something that can be fixed with the views found in the viewhiearchy. One workaround for this is enabling texture mode on the one that isn't visible atm (you can do this through xml or MapboxMapOptions). Closing as this is how gl surfaces work and we do not provide support for z ordering mulitple surfaces, |
@tobrun thanks for explaining |
@tobrun texture mode is deprecated though, right? |
We use SurfaceView as preferred rendering surface as it's more performant in general (Android SDK View syncing is actually better on a TextureView). We keep the option of TextureView open as long as we can support it without too much trouble. Note that for |
This bug still exists painfully! |
@mhr9o20 this is worked as designed when using a SurfaceView, please use TextureView instead. |
@mhr9o2o actually it's not a bug. U can handle only one |
Thanks for your responses, the problem is that this bug only exists on devices running <7 Androids. |
You can enable TextureView with either xml attributes: <com.mapbox.mapboxsdk.maps.MapView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:mapbox_renderTextureMode="true"/> or MapboxMapOptions: MapboxMapOptions options = new MapboxMapOptions().textureMode(true);
mapView = new MapView(this, options); |
Thanks a million, I'll try this way as soon as possible and I'll inform you if anything was wrong. |
As long as I could check, from API 17 to 28, using TextureView solved the issue. Thanks again. |
Platform: Android
Mapbox SDK version: 4.2.2 and latest
Steps:
...All correct
...
Result: Map in second fragment fully transparent but mapbox logo is showed. And we see map from first fragment.
If don't add first layout, second layout is working correctly.
I created demo application for show
See: https://github.com/vacxe/MapboxMultilayerProblem
@bleege @tobrun folks, please help me
The text was updated successfully, but these errors were encountered: