我正在尝试使用mapbox上的json文件公开创建新样式。
文档(https://docs.mapbox.com/api/maps/#create-a-style)表示我们可以使用命令
创建新样式curl -X POST "https://api.mapbox.com/styles/v1/urbaneaseantho?access_token=sYOURTOKEN" --data @test2.json --header "Content-Type:application/json"
返回说是上传:
{"version":8,"name":"My Awesome Style","metadata":{},"sources":{"myvectorsource":{"url":"mapbox://{map_id}","type":"vector"},"myrastersource":{"url":"mapbox://{map_id}","type":"raster"}},"sprite":"mapbox://sprites/urbaneaseantho/cjw0ebb5v01p41co9znianoam/ck2u8j60r58fu0sgyxrigm3cu","glyphs":"mapbox://fonts/urbaneaseantho/{fontstack}/{range}.pbf","layers":[],"created":"2019-05-23T08:29:54.901Z","id":"cjw0ebb5v01p41co9znianoam","modified":"2019-05-23T08:29:54.901Z","owner":"urbaneaseantho","visibility":"private"}
我的问题是可见性,我需要默认设置为“公开”。
在我的test2.json文件中使用““ visibility”:“ public”,结果相同,如果添加“ draft”:false,则mapbox不需要我的文件
其他尝试更新样式的方法,但是在使用时
curl -X POST "https://api.mapbox.com/styles/v1/urbaneaseantho/STYLE_ID?access_token=TOKEN" --data @test_update.json --header "Content-Type:application/json"
返回是
{"message":"Not Found"}
是否有可能是api限制?
谢谢
答案 0 :(得分:0)
Mapbox支持的解决方案: