我正在尝试使用here概述的样式规格表自定义我的MapBox地图,但我收到了源错误。
我目前的样式表是:
{
"version": 8,
"sources": {
"simple-tiles": {
"type": "raster",
"url": "mapbox://mapbox.streets",
"tileSize": 256
}
},
"layers": [
{
"id": "simple-tiles",
"type": "raster",
"source": "simple-tiles"
},
{
"id": "water",
"source": "mapbox-streets",
"source-layer": "water",
"type": "fill",
"paint": {
"fill-color": "#000000"
}
}
]
}
但是我收到了这个错误,地图上的水景不受影响:
{Map}[Render]: can't find source for layer 'water'
我无法使用MapBox for Android的自定义样式表找到完整的示例。关于我为什么会收到此错误的任何想法?
答案 0 :(得分:1)
图层
{
"id": "water",
"source": "mapbox-streets",
"source-layer": "water",
"type": "fill",
"paint": {
"fill-color": "#000000"
}
}
行source: "mapbox-streets"
,但此样式不包含Mapbox Streets作为源。如果你想使用这个水层,你需要包含mapbox-streets
源,这可能是你从这个源派生的样式中定义的。如果没有,您需要删除water
图层。