MapBox 地图样式规范 Sheet - 无法找到层的源 (Android)
MapBox Map Style Spec Sheet - Can't Find Source For Layer (Android)
我正在尝试使用 sheet 概述 here 的样式规范为 Android 自定义我的 MapBox 地图的样式,但出现源错误。
我目前的风格sheet是:
{
"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'
我一直无法找到使用自定义样式 sheet for MapBox for Android 的完整示例。关于我为什么会收到此错误的任何想法?
图层
{
"id": "water",
"source": "mapbox-streets",
"source-layer": "water",
"type": "fill",
"paint": {
"fill-color": "#000000"
}
}
有行 source: "mapbox-streets"
,但此样式不包含 Mapbox Streets 作为来源。如果你想使用这个水层,你需要包括 mapbox-streets
来源,它可能是在你派生这个的样式中定义的。如果没有,您需要删除 water
图层。
我正在尝试使用 sheet 概述 here 的样式规范为 Android 自定义我的 MapBox 地图的样式,但出现源错误。
我目前的风格sheet是:
{
"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'
我一直无法找到使用自定义样式 sheet for MapBox for Android 的完整示例。关于我为什么会收到此错误的任何想法?
图层
{
"id": "water",
"source": "mapbox-streets",
"source-layer": "water",
"type": "fill",
"paint": {
"fill-color": "#000000"
}
}
有行 source: "mapbox-streets"
,但此样式不包含 Mapbox Streets 作为来源。如果你想使用这个水层,你需要包括 mapbox-streets
来源,它可能是在你派生这个的样式中定义的。如果没有,您需要删除 water
图层。