GeoJSON data (Feature, FeatureCollection, or Geometry)
Tile zoom level
Tile x coordinate
Tile y coordinate
Optional configuration for tile generation
The generated tile with geometries in tile coordinates, or null if no features
import {geoJSONToTile} from '@maplibre/geojson-vt';
const geojson = {
type: 'FeatureCollection',
features: [{
type: 'Feature',
geometry: { type: 'Point', coordinates: [-77.03, 38.90] },
properties: { name: 'Washington, D.C.' }
}]
};
const tile = geoJSONToTile(geojson, 10, 292, 391, { extent: 4096 });
Converts GeoJSON data directly to a single vector tile without building a tile index.
Unlike the GeoJSONVT class which builds a hierarchical tile index for efficient repeated tile access, this function generates a single tile on-demand. This is useful when: