mirror of
https://github.com/maputnik/editor.git
synced 2026-02-19 02:50:06 +00:00
cleaned up props name and console logging
This commit is contained in:
@@ -131,7 +131,7 @@ type AppState = {
|
||||
debug: boolean
|
||||
}
|
||||
fileHandle: FileSystemFileHandle | null
|
||||
file: PMTiles | null
|
||||
localPMTiles: PMTiles | null
|
||||
}
|
||||
|
||||
export default class App extends React.Component<any, AppState> {
|
||||
@@ -288,7 +288,7 @@ export default class App extends React.Component<any, AppState> {
|
||||
debugToolbox: false,
|
||||
},
|
||||
fileHandle: null,
|
||||
file: null
|
||||
localPMTiles: null
|
||||
}
|
||||
|
||||
this.layerWatcher = new LayerWatcher({
|
||||
@@ -743,7 +743,7 @@ export default class App extends React.Component<any, AppState> {
|
||||
onChange={this.onMapChange}
|
||||
options={this.state.maplibreGlDebugOptions}
|
||||
inspectModeEnabled={this.state.mapState === "inspect"}
|
||||
file={this.state.file}
|
||||
localPMTiles={this.state.localPMTiles}
|
||||
highlightedLayer={this.state.mapStyle.layers[this.state.selectedLayerIndex]}
|
||||
onLayerSelect={this.onLayerSelect} />
|
||||
}
|
||||
@@ -888,7 +888,7 @@ export default class App extends React.Component<any, AppState> {
|
||||
const file = e[0];
|
||||
const pmt = new PMTiles(new FileSource(file));
|
||||
this.setState({
|
||||
file: pmt
|
||||
localPMTiles: pmt
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ type MapMaplibreGlInternalProps = {
|
||||
}
|
||||
replaceAccessTokens(mapStyle: StyleSpecification): StyleSpecification
|
||||
onChange(value: {center: LngLat, zoom: number}): unknown
|
||||
file: PMTiles | null;
|
||||
localPMTiles: PMTiles | null;
|
||||
} & WithTranslation;
|
||||
|
||||
type MapMaplibreGlState = {
|
||||
@@ -138,16 +138,16 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (this.props.file) {
|
||||
const file = this.props.file;
|
||||
if (this.props.localPMTiles) {
|
||||
const file = this.props.localPMTiles;
|
||||
this.state.protocol!.add(file); // this is necessary for non-HTTP sources
|
||||
|
||||
if (map) {
|
||||
file.getMetadata().then((metadata: any) => {
|
||||
const layerNames = metadata.vector_layers.map((e: LayerSpecification) => e.id);
|
||||
|
||||
// used by maplibre-gl-inspect to pick up inspectable layers
|
||||
map.style.sourceCaches["source"]._source.vectorLayerIds = layerNames;
|
||||
console.log("layerNames for inspect:", layerNames);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user