How to use API to receive vector tiles with Mapbox?

I see you have documentation to use the API with MapLibre, is there any support with mapbox?

If so, I have a need to dynamically pull in vector tiles for different time periods. The input could would a be a year and could potentially be hundreds of years. So I would need to dynamically fetch tiles for different years basically.

My current setup uses Mapbox GLJS, vanilla JS, I also use a tileserver to serve vector tiles when needed. Mapbox needs to dynamically add the z,x, and y values. Would this be possible with the API or is there another viable option for my needs?

 map.addSource('countries', {
    type: 'vector',
    tiles: ['http://localhost:3000/data/countries/{z}/{x}/{y}.pbf'],
    minzoom: 1,
    maxzoom: 5,
  });

  map.addLayer({
    id: 'countriesLayer',
    type: 'fill',
    source: 'countries',
    'source-layer': 'country_bordersgeo',
    paint: {
      'fill-color': '#888',
      'fill-opacity': 0.5,
    },
  });

Hi, the documentation for MapLibre GL JS should apply to Mapbox GL JS as well. The tile URL template (documented further up) is:

https://vtiles.openhistoricalmap.org/maps/osm/{z}/{x}/{y}.pbf

Administrative boundaries are in the land_ohm_lines source layer.

You’ll also need to filter the features by date, or else you’ll see lots of anachronistic overlapping features. The MapLibre GL Dates plugin might be compatible with Mapbox GL JS. It’s an NPM package, but you can obtain a plain-vanilla JavaScript copy directly from the unpkg CDN. If that doesn’t work, you can crib the source code to do the filtering in your own code.

@jordanss1 - what are you working on? Is it something you can share externally? We’d love to see what people are doing with OHM data!