I'm trying to use an endpoint in Mapbox vector tile format. I can access the .pbf's ok, but there's no documentation or TileJSON endpoint.
How can I find the names of layers that exist within the tiles? That is, the value that I would set to source-layer
in a vector
source in Mapbox-GL-JS.
Theoretically this must be doable, but I don't know any tool that lets me achieve this.
(In this particular case, it's a WMTS endpoint on GeoServer, but I'd be more interested in solutions that work generally.)
Best Answer
If you're okay to write a NodeJS script you can use
https://github.com/mapbox/vector-tile-js#api-reference
Try this on Runkit: https://runkit.com/stevebennett/get-layer-names-and-keys-from-vector-tile