Skip to content

Commit

Permalink
[fix]window.mapboxgl.mapbox.VectorTile
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiao-supermap committed May 10, 2024
1 parent 3a2de14 commit c515889
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/source/src/source/vector.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Feature, Properties } from '@turf/helpers';
import { VectorTile } from '@mapbox/vector-tile';
import Protobuf from 'pbf';
import { ITileSource } from '../interface';
import { toLngLat } from '../../../maps/src/mapbox/utils'
import { global } from '../../../maps/src/mapbox/mapInstance'

const VectorTile = window.mapboxgl.mapbox.VectorTile;

export default class VectorSource implements ITileSource {
private vectorTile: VectorTile;
Expand All @@ -19,7 +19,8 @@ export default class VectorSource implements ITileSource {
this.x = x;
this.y = y;
this.z = z;
this.vectorTile = new VectorTile(new Protobuf(data)) as VectorTile;
const MultiVectorTile = window.mapboxgl.mapbox.VectorTile;
this.vectorTile = new MultiVectorTile(new Protobuf(data)) as VectorTile;
}

public getTileData(sourceLayer: string) {
Expand Down

0 comments on commit c515889

Please sign in to comment.