mirror of
https://github.com/maputnik/editor.git
synced 2026-08-24 14:07:33 +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[]) => {
|
onFileSelected = (e: File[]) => {
|
||||||
var file = e[0];
|
const file = e[0];
|
||||||
var pmt = new PMTiles(new FileSource(file));
|
const pmt = new PMTiles(new FileSource(file));
|
||||||
console.log("App.onFileSelected", pmt);
|
|
||||||
this.setState({
|
this.setState({
|
||||||
file: pmt
|
file: pmt
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -295,10 +295,10 @@ class AppToolbarInternal extends React.Component<AppToolbarInternalProps> {
|
|||||||
|
|
||||||
<Dropzone onDrop={this.props.onFileSelected}>
|
<Dropzone onDrop={this.props.onFileSelected}>
|
||||||
{({getRootProps, getInputProps}) => (
|
{({getRootProps, getInputProps}) => (
|
||||||
<div {...getRootProps({className: 'dropzone maputnik-toolbar-link'})}>
|
<div {...getRootProps({className: 'dropzone maputnik-toolbar-link'})}>
|
||||||
<input {...getInputProps()} />
|
<input {...getInputProps()} />
|
||||||
Drop file here
|
Drop file here
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Dropzone>
|
</Dropzone>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -139,12 +139,12 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.file) {
|
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
|
this.state.protocol!.add(file); // this is necessary for non-HTTP sources
|
||||||
|
|
||||||
if (map) {
|
if (map) {
|
||||||
file.getMetadata().then((metadata: any) => {
|
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;
|
map.style.sourceCaches["source"]._source.vectorLayerIds = layerNames;
|
||||||
console.log("layerNames for inspect:", layerNames);
|
console.log("layerNames for inspect:", layerNames);
|
||||||
@@ -166,7 +166,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
|
|||||||
localIdeographFontFamily: false
|
localIdeographFontFamily: false
|
||||||
} satisfies MapOptions;
|
} satisfies MapOptions;
|
||||||
|
|
||||||
let protocol = this.state.protocol;
|
const protocol = this.state.protocol;
|
||||||
MapLibreGl.addProtocol("pmtiles", protocol!.tile);
|
MapLibreGl.addProtocol("pmtiles", protocol!.tile);
|
||||||
|
|
||||||
const map = new MapLibreGl.Map(mapOpts);
|
const map = new MapLibreGl.Map(mapOpts);
|
||||||
|
|||||||
Reference in New Issue
Block a user