mirror of
https://github.com/maputnik/editor.git
synced 2026-02-08 21:50:00 +00:00
fixed lint errors
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user