Does the MVTLoader allow tiles with .pbf extension? #3205
Replies: 2 comments
-
|
I'm also beginning to wonder if it something on my end with how our |
Beta Was this translation helpful? Give feedback.
-
|
I figured out the answer to my issue. The tiles were created using // imports
import { MVTLoader } from '@loaders.gl/mvt';
import { parse } from '@loaders.gl/core';
// types
import type { Loader, LoaderOptions } from '@loaders.gl/core';
// This function handles calls for tiles that don't exist, since some datasets
// are not perfectly square or have features edge-to-edge, which results in a
// tile not being created in that space. Currently, loaders.gl will throw an
// unimplemented error due to the content-type returned from non-existent tiles.
export const HandleFetchNonExistentTilesForMVTLayer = async (
url: string,
{
loaders,
loadOptions,
signal,
}: {
loaders?: Loader[];
loadOptions?: LoaderOptions;
signal?: AbortSignal;
}
) => {
const response = await fetch(url, {
signal,
});
const contentType = response.headers.get('content-type');
if (contentType !== 'application/x-protobuf') {
// non-existent tiles pass text/html to content-type header
return;
}
return parse(
response,
loaders && loaders.length ? loaders[0] : MVTLoader, //specify MVT loader unless another one is passed
loadOptions!
);
}; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I was wondering if the MVTLoader allows tiles with a
.pbfextension? Reading the MVTLoader documentation mentions only the.mvtextension but I know both are implementations of the same protobuf protocol, just that.mvthappens to be what Mapbox calls their tiles.Part of my inquiry is trying to trace the error
Worker exception: Error: Unimplemented type: 4that appears to come from loaders.gl. I can also open an issue if that is a more appropriate channel. Thanks!Beta Was this translation helpful? Give feedback.
All reactions