【问题标题】:Mapbox iOS GL black background layer issueMapbox iOS GL黑色背景图层问题
【发布时间】:2016-06-25 15:55:02
【问题描述】:

我尝试在mapbox-iOS-SDK gl 3.2.3 中实现光栅图块

这是我的本地风格来源:

{
"version": 8,
"name": "2GIS tiles",
"sources": {
    "mainSource": {
        "type": "raster",
        "tiles": [
                  "http://tile1.maps.2gis.com/tiles?x={x}&y={y}&z={z}&v=1"
                  ],
        "tileSize": 128
    }
},
"layers": [
           {
           "id": "background",
           "type": "background",
           "paint": {
               "fill-color": "#FFF9E8"
           }
           },
           {
           "id": "mainLayer",
           "type": "raster",
           "source": "mainSource",
           "paint": {
               "raster-fade-duration": 100
           }
           }
           ]
}

这是我得到的click-me

因此,在滚动或平移地图时,有时会在加载图块时出现黑色背景。

我该如何解决这个问题?可以改黑色吗?

【问题讨论】:

    标签: ios swift mapbox mapbox-gl


    【解决方案1】:

    尝试将paint 属性从fill-color 更改为background-color

    例如,

    {
      "id": "background",
      "type": "background",
      "paint": {
        "background-color": "#FFF9E8"
      }
    }
    

    Mapbox GL Style Referencepaint 提到了这一点,这应该可以解释您看到的黑色背景。

    background-color
    可选颜色。 默认为 #000000。被背景图案禁用。 绘制背景的颜色。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-14
      • 2020-03-21
      • 1970-01-01
      • 2018-04-20
      • 2016-07-10
      • 1970-01-01
      • 2018-05-14
      • 1970-01-01
      相关资源
      最近更新 更多