我遇到了Mapbox-GL-JS的问题,在我的浏览器中有缓存的矢量图块,无法看到最近的更改。正常的解决方法是example.com/tiles/1/2/3.png?update=1
在磁贴字符串()的末尾附加一个唯一的字符串,但是我不确定如何在Mapbox-GL-JS中使它起作用,因为它是根据以下内容的组合为我构造磁贴字符串的层数:
... metadata": { "mapbox:autocomposite": true, "mapbox:type": "default" }, "sources": { "mapbox": { "url": "mapbox://mapbox.satellite", "type": "raster", "tileSize": 256 }, "composite": { "url": "mapbox://stevage.9vj4wkw3,mapbox.mapbox-streets-v7,stevage.ab95cml8", "type": "vector" } },
是否有某种方法可以将一些额外的文本强制放入URL?
mapbox://
网址末尾的所有查询参数都将保留。您可能会发现有趣的fresh
参数,我们使用特殊参数跳过大多数API端缓存。
... metadata": { "mapbox:autocomposite": true, "mapbox:type": "default" }, "sources": { "mapbox": { "url": "mapbox://mapbox.satellite?fresh=true", "type": "raster", "tileSize": 256 }, "composite": { "url": "mapbox://stevage.9vj4wkw3,mapbox.mapbox-streets-v7,stevage.ab95cml8?fresh=true", "type": "vector" } },