【问题标题】:Android Mapbox Mapview shows white screen before rendering mapsAndroid Mapbox Mapview 在渲染地图之前显示白屏
【发布时间】:2020-04-01 21:40:19
【问题描述】:

Mapbox Mapview 在 Mapview 被渲染之前显示一个白屏闪烁。闪光灯会停留大约 500 毫秒,之后会显示地图。我在运行时将 Mapview 动态添加到我的 FrameLayout((addView())。下面是代码 sn-p。请帮助!

private fun initializeMapBoxMap() {
    val mapView = MapView(context) // create new mapview 
    innerLayout.addView(mapView) // add mapView to the FrameLayout
    mapView.getMapAsync { mapboxMap ->
           // white screen shown at this point for 500 ms 
           mapboxMap.setStyle(Style.DARK) {
              // white screen gone at this point
           }

    }
}

截图链接:screenshot link

【问题讨论】:

  • 白屏出现在模拟器还是物理设备上?如果您只在模拟器上看到过这种情况,我建议您在物理设备上也进行测试,因为与实际硬件相比,模拟器性能是次优的。

标签: android android-layout mapbox android-mapview mapbox-android


【解决方案1】:

必须将颜色更改为另一种颜色: mapboxMapOptions.foregroundLoadColor(int color)

我们试图掩盖 glsurfaceview 已加载但我们没有任何内容要呈现,因为我们仍在加载样式定义。而不是加载资源,让它们离线也将改善用户体验。

感谢 tobrun 提供的信息 https://github.com/mapbox/mapbox-gl-native/issues/16367

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-10-17
    • 1970-01-01
    • 2023-03-14
    • 2022-08-24
    • 2019-07-12
    • 1970-01-01
    • 2013-05-16
    相关资源
    最近更新 更多