Skip to content

Commit

Permalink
fix for Inspect to work with FileSource
Browse files Browse the repository at this point in the history
  • Loading branch information
prusswan committed Jan 23, 2025
1 parent 7ee8e44 commit 0fbda5d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/MapMaplibreGl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,19 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
}

if (this.props.file) {

Check failure on line 139 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build artifacts

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.

Check failure on line 139 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build on ubuntu-latest

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.

Check failure on line 139 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build on windows-latest

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.

Check failure on line 139 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build on macos-latest

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.
this.state.protocol.add(this.props.file); // this is necessary for non-HTTP sources
let file = this.props.file;

Check failure on line 140 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build artifacts

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.

Check failure on line 140 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build on ubuntu-latest

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.

Check failure on line 140 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build on windows-latest

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.

Check failure on line 140 in src/components/MapMaplibreGl.tsx

View workflow job for this annotation

GitHub Actions / build on macos-latest

Property 'file' does not exist on type 'Readonly<MapMaplibreGlInternalProps>'.
this.state.protocol.add(file); // this is necessary for non-HTTP sources

if (map) {
file.getMetadata().then((metadata) => {
let layerNames = metadata.vector_layers.map((e) => e.id);

map.style.sourceCaches["source"]._source.vectorLayerIds = layerNames;
console.log("layerNames for inspect:", layerNames);
});
}
}

}

componentDidMount() {
Expand Down

0 comments on commit 0fbda5d

Please sign in to comment.