diff --git a/modules/carto/src/layers/carto-tile-layer.ts b/modules/carto/src/layers/carto-tile-layer.ts index 26be1ecb4dc..c727a7e0e43 100644 --- a/modules/carto/src/layers/carto-tile-layer.ts +++ b/modules/carto/src/layers/carto-tile-layer.ts @@ -57,19 +57,9 @@ export default class CartoTileLayer extends MVTLayer return Promise.reject('Invalid URL'); } - let loadOptions = this.getLoadOptions(); - const {fetch, formatTiles} = this.props; + const loadOptions = this.getLoadOptions(); + const {fetch} = this.props; const {signal} = tile; - - // The backend doesn't yet support our custom mime-type, so force it here - // TODO remove once backend sends the correct mime-type - if (formatTiles === TILE_FORMATS.BINARY) { - loadOptions = { - ...loadOptions, - mimeType: 'application/vnd.carto-vector-tile' - }; - } - return fetch(url, {propName: 'data', layer: this, loadOptions, signal}); } diff --git a/modules/carto/src/layers/h3-tile-layer.ts b/modules/carto/src/layers/h3-tile-layer.ts index dfa3271ad54..94caaef5ec5 100644 --- a/modules/carto/src/layers/h3-tile-layer.ts +++ b/modules/carto/src/layers/h3-tile-layer.ts @@ -98,8 +98,7 @@ export default class H3TileLayer exten maxZoom: maxresolution, loadOptions: { ...this.getLoadOptions(), - cartoSpatialTile: {scheme: 'h3'}, - mimeType: 'application/vnd.carto-spatial-tile' + cartoSpatialTile: {scheme: 'h3'} } }) ]; diff --git a/modules/carto/src/layers/quadbin-tile-layer.ts b/modules/carto/src/layers/quadbin-tile-layer.ts index 3ae95ccc82e..e62b09b16f3 100644 --- a/modules/carto/src/layers/quadbin-tile-layer.ts +++ b/modules/carto/src/layers/quadbin-tile-layer.ts @@ -71,8 +71,7 @@ export default class QuadbinTileLayer< maxZoom, loadOptions: { ...this.getLoadOptions(), - cartoSpatialTile: {scheme: 'quadbin'}, - mimeType: 'application/vnd.carto-spatial-tile' + cartoSpatialTile: {scheme: 'quadbin'} } }) ]; diff --git a/test/modules/carto/mock-fetch.ts b/test/modules/carto/mock-fetch.ts index 8c3a1d027f0..e290187b979 100644 --- a/test/modules/carto/mock-fetch.ts +++ b/test/modules/carto/mock-fetch.ts @@ -78,6 +78,9 @@ function mockFetchMapsV2() { export function mockFetchMapsV3() { const fetch = globalThis.fetch; globalThis.fetch = (url, {headers}) => { + if (url.indexOf('formatTiles=binary') !== -1) { + headers = {...headers, 'Content-Type': 'application/vnd.carto-vector-tile'}; + } return Promise.resolve({ json: () => { if (url.indexOf('format=tilejson') !== -1) {