Geojson-vt TileIndex.getTile() returns the JSON version of the Mapbox vector tile specifier:

I do not know any library that can display this format. Indeed, Mapbox's own demo implements rendering at a fairly low level:
var tile = tileIndex.getTile(z, x, y); console.timeEnd('getting tile z' + z + '-' + x + '-' + y); if (!tile) { console.log('tile empty'); zoomOut(); return; } // console.log('z%d-%d-%d: %d points of %d', z, x, y, tile.numSimplified, tile.numPoints); // console.time('draw'); ctx.clearRect(0, 0, height, height); var features = tile.features; ctx.strokeStyle = 'red'; ctx.fillStyle = 'rgba(255,0,0,0.05)'; for (var i = 0; i < features.length; i++) { var feature = features[i], type = feature.type; ctx.beginPath(); for (var j = 0; j < feature.geometry.length; j++) { var geom = feature.geometry[j]; if (type === 1) { ctx.arc(geom[0] * ratio + pad, geom[1] * ratio + pad, 2, 0, 2 * Math.PI, false); continue; } for (var k = 0; k < geom.length; k++) { var p = geom[k]; if (k) ctx.lineTo(p[0] * ratio + pad, p[1] * ratio + pad); else ctx.moveTo(p[0] * ratio + pad, p[1] * ratio + pad); } } if (type === 3 || type === 1) ctx.fill('evenodd'); ctx.stroke(); } drawGrid();
You can use some of your codes to help you.
There are various links in README and a related blog post for Mapbox-gl-js to work based on geojson-vt, but there are no explicit instructions on how to do this. Perhaps the best approach is to just use mapbox-gl-js GeoJSONSource .
Steve bennett
source share