Lots of refactoring, first version of the import helper

This commit is contained in:
Pieter Vander Vennet 2022-01-19 20:34:04 +01:00
parent 612b8136ad
commit 3402ac0954
54 changed files with 1104 additions and 315 deletions

View file

@ -38,6 +38,8 @@ export default class LocationInput extends InputElement<Loc> implements MinimapO
private readonly _snappedPointTags: any;
private readonly _bounds: UIEventSource<BBox>;
private readonly map: BaseUIElement & MinimapObj;
public readonly bounds;
public readonly location;
private readonly clickLocation: UIEventSource<Loc>;
private readonly _minZoom: number;
@ -146,6 +148,8 @@ export default class LocationInput extends InputElement<Loc> implements MinimapO
}
)
this.leafletMap = this.map.leafletMap
this.bounds = this.map.bounds;
this.location = this.map.location;
}
GetValue(): UIEventSource<Loc> {
@ -186,11 +190,10 @@ export default class LocationInput extends InputElement<Loc> implements MinimapO
console.log("Constructing the snap-to layer", this._snapTo)
new ShowDataMultiLayer({
features: new StaticFeatureSource(this._snapTo, true),
enablePopups: false,
popup: undefined,
zoomToFeatures: false,
leafletMap: this.map.leafletMap,
layers: State.state.filteredLayers,
allElements: State.state.allElements
layers: State.state.filteredLayers
}
)
// Show the central point
@ -202,11 +205,11 @@ export default class LocationInput extends InputElement<Loc> implements MinimapO
})
new ShowDataLayer({
features: new StaticFeatureSource(matchPoint, true),
enablePopups: false,
popup: undefined,
zoomToFeatures: false,
leafletMap: this.map.leafletMap,
layerToShow: this._matching_layer,
allElements: State.state.allElements,
state: State.state,
selectedElement: State.state.selectedElement
})