forked from MapComplete/MapComplete
Finish importer, add applicable import layers to every theme by default
This commit is contained in:
parent
3402ac0954
commit
ca1490902c
41 changed files with 1559 additions and 898 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import {Translation} from "../i18n/Translation";
|
||||
import Combine from "./Combine";
|
||||
import Svg from "../../Svg";
|
||||
import Translations from "../i18n/Translations";
|
||||
import BaseUIElement from "../BaseUIElement";
|
||||
|
||||
export default class Loading extends Combine {
|
||||
constructor(msg?: Translation | string) {
|
||||
const t = Translations.T(msg) ?? Translations.t.general.loading.Clone();
|
||||
constructor(msg?: BaseUIElement | string) {
|
||||
const t = Translations.W(msg) ?? Translations.t.general.loading;
|
||||
t.SetClass("pl-2")
|
||||
super([
|
||||
Svg.loading_svg().SetClass("animate-spin").SetStyle("width: 1.5rem; height: 1.5rem;"),
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export default class Minimap {
|
|||
/**
|
||||
* Construct a minimap
|
||||
*/
|
||||
public static createMiniMap: (options: MinimapOptions) => (BaseUIElement & MinimapObj) = (_) => {
|
||||
public static createMiniMap: (options?: MinimapOptions) => (BaseUIElement & MinimapObj) = (_) => {
|
||||
throw "CreateMinimap hasn't been initialized yet. Please call MinimapImplementation.initialize()"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
|||
private readonly _addLayerControl: boolean;
|
||||
private readonly _options: MinimapOptions;
|
||||
|
||||
private constructor(options: MinimapOptions) {
|
||||
private constructor(options?: MinimapOptions) {
|
||||
super()
|
||||
options = options ?? {}
|
||||
this.leafletMap = options.leafletMap ?? new UIEventSource<Map>(undefined)
|
||||
|
|
@ -290,12 +290,6 @@ export default class MinimapImplementation extends BaseUIElement implements Mini
|
|||
map.setView([loc.lat, loc.lon], loc.zoom)
|
||||
})
|
||||
|
||||
location.map(loc => loc.zoom)
|
||||
.addCallback(zoom => {
|
||||
if (Math.abs(map.getZoom() - zoom) > 0.1) {
|
||||
map.setZoom(zoom, {});
|
||||
}
|
||||
})
|
||||
|
||||
if (self.bounds !== undefined) {
|
||||
self.bounds.setData(BBox.fromLeafletBounds(map.getBounds()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue