Mapbox样式表JSON的URL [英] URL for Mapbox style sheet JSON
本文介绍了Mapbox样式表JSON的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否存在为给定样式提供样式表JSON的URL?所有网址都在Mapbox方案中:
Is there a URL that serves up the style sheet JSON for a given style? All the URL's are in Mapbox scheme:
mapbox://styles/wfisher/41dj33random72ravc31c5dyn
但是我想直接在加载时下载JSON,因此可以在将Javascript对象传递给< ReactMapGL>
之前对其进行修改.
But I'd like to download the JSON directly on load so I can modify it before passing in a Javascript object to <ReactMapGL>
.
推荐答案
您必须使用Mapbox静态API:
You have to use the Mapbox Static API:
https://www.mapbox.com/api-documentation/#retrieve-a-style
因此URL为:
https://api.mapbox.com/styles/v1/wfisher/41dj33random72ravc31c5dyn?access_token=<token>
,如果您也使用 Accept-Encoding
,则服务器将对其进行压缩.
and the sever will compress it if you use Accept-Encoding
, too.
这篇关于Mapbox样式表JSON的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文