在 mapbox gl js 中为 pbf 或栅格使用子域的正确方法

Proper way to use subdomains for pbf or raster in mapbox gl js

{s}.Link.to.tiles 在源的 "url" 中不起作用。我将 "tiles" 中的所有子域添加为一个数组。这是在 mapbox gl js 中使用子域的正确方法吗?

Mapbox 样式规范说 tiles:

An array of one or more tile source URLs, as in the TileJSON spec.

TileJSON 规范说 tiles:

REQUIRED. An array of tile endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoints MUST return the same content for the same URL. The array MUST contain at least one endpoint.

因此,{s} 不受支持,指定子域的正确方法是在数组中显式列出完整的 URL,正如您所做的那样。