Skip to content

Commit bd917f8

Browse files
committed
Improve exports
1 parent ab1a74b commit bd917f8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/geojson_wrapper.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import Point from '@mapbox/point-geometry';
22
import type {TileFeature, AnyProps} from 'supercluster';
33
import {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

612
export 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+
5664
export 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

Comments
 (0)