Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
prusswan committed Jan 24, 2025
1 parent cdfe88f commit 9db49ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -885,9 +885,8 @@ export default class App extends React.Component<any, AppState> {
}

onFileSelected = (e: File[]) => {
var file = e[0];
var pmt = new PMTiles(new FileSource(file));
console.log("App.onFileSelected", pmt);
const file = e[0];
const pmt = new PMTiles(new FileSource(file));
this.setState({
file: pmt
})
Expand Down
8 changes: 4 additions & 4 deletions src/components/AppToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ class AppToolbarInternal extends React.Component<AppToolbarInternalProps> {

<Dropzone onDrop={this.props.onFileSelected}>
{({getRootProps, getInputProps}) => (
<div {...getRootProps({className: 'dropzone maputnik-toolbar-link'})}>
<input {...getInputProps()} />
Drop file here
</div>
<div {...getRootProps({className: 'dropzone maputnik-toolbar-link'})}>
<input {...getInputProps()} />
Drop file here
</div>
)}
</Dropzone>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/MapMaplibreGl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
}

if (this.props.file) {
let file = this.props.file;
const file = this.props.file;
this.state.protocol!.add(file); // this is necessary for non-HTTP sources

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

map.style.sourceCaches["source"]._source.vectorLayerIds = layerNames;
console.log("layerNames for inspect:", layerNames);
Expand All @@ -166,7 +166,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
localIdeographFontFamily: false
} satisfies MapOptions;

let protocol = this.state.protocol;
const protocol = this.state.protocol;
MapLibreGl.addProtocol("pmtiles", protocol!.tile);

const map = new MapLibreGl.Map(mapOpts);
Expand Down

0 comments on commit 9db49ee

Please # to comment.