我需要更改 y 轴的计算。那么,如何使用 mapboxgl js API 自定义此轴?

I need to change the calculations for the y-axis. So, how can I customize this axis using the mapboxgl js API?

我需要更改图块中的 Y 轴 URL。我用下面的函数来改变轴,

map.addCustomSource('foo', {
    "type": "vector",
    "tiles": function(coord) {
      return "some computation using coord";
    }
})

但它引发了 map.addCustomSource is not a function 错误。 如何使用 Mapboxgl.js API?

自定义此轴

这取决于您要如何准确地转换图块坐标,如果它要匹配 OGC TMS 规范,您可以使用 "scheme": "tms" 参见 https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-raster-scheme