11import Point from '@mapbox/point-geometry' ;
22import type { TileFeature , AnyProps } from 'supercluster' ;
33import { type Feature as GeoJSONVTFeature , Geometry } from 'geojson-vt' ;
4- import type { VectorTileFeatureLike , VectorTileLayerLike } from './types' ;
4+ import type {
5+ VectorTileFeatureLike ,
6+ VectorTileLayerLike ,
7+ VectorTileLike ,
8+ } from "./types" ;
9+
10+ export { VectorTileFeatureLike , VectorTileLayerLike , VectorTileLike } ;
511
612export type Feature = TileFeature < AnyProps , AnyProps > | GeoJSONVTFeature ;
713
@@ -53,6 +59,8 @@ class FeatureWrapper implements VectorTileFeatureLike {
5359 }
5460}
5561
62+ export const GEOJSON_TILE_LAYER_NAME = "_geojsonTileLayer" ;
63+
5664export class GeoJSONWrapper implements VectorTileLayerLike {
5765 layers : Record < string , VectorTileLayerLike > ;
5866 features : Feature [ ] ;
@@ -62,8 +70,8 @@ export class GeoJSONWrapper implements VectorTileLayerLike {
6270 length : VectorTileLayerLike [ 'length' ] ;
6371
6472 constructor ( features : Feature [ ] , options ?: GeoJSONOptions ) {
65- this . layers = { '_geojsonTileLayer' : this } ;
66- this . name = '_geojsonTileLayer' ;
73+ this . layers = { [ GEOJSON_TILE_LAYER_NAME ] : this } ;
74+ this . name = GEOJSON_TILE_LAYER_NAME ;
6775 this . version = options ? options . version : 1 ;
6876 this . extent = options ? options . extent : 4096 ;
6977 this . length = features . length ;
0 commit comments