Fix: addnewpoint-dialog works again
This commit is contained in:
parent
61c417c546
commit
8ed0a32d15
4 changed files with 24 additions and 16 deletions
|
@ -45,8 +45,8 @@
|
||||||
visible.setData(false)
|
visible.setData(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPref(type: CategoryType): UIEventSource<string> {
|
function getPref(type: CategoryType): undefined | UIEventSource<string> {
|
||||||
return userstate.osmConnection.GetPreference("preferred-layer-" + type)
|
return userstate?.osmConnection?.GetPreference("preferred-layer-" + type)
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
let dispatch = createEventDispatcher<{appliedLayer}>()
|
let dispatch = createEventDispatcher<{appliedLayer}>()
|
||||||
|
|
||||||
export let favourite : UIEventSource<string> = undefined
|
export let favourite : UIEventSource<string> | undefined = undefined
|
||||||
|
|
||||||
|
|
||||||
let rasterLayer = new UIEventSource<RasterLayerPolygon>(availableLayers.data?.[0])
|
let rasterLayer = new UIEventSource<RasterLayerPolygon>(availableLayers.data?.[0])
|
||||||
|
@ -39,11 +39,11 @@
|
||||||
}
|
}
|
||||||
rasterLayer.setData(fav)
|
rasterLayer.setData(fav)
|
||||||
}))
|
}))
|
||||||
}
|
|
||||||
|
|
||||||
onDestroy(rasterLayer.addCallbackAndRunD(selected => {
|
onDestroy(rasterLayer.addCallbackAndRunD(selected => {
|
||||||
favourite?.setData(selected.properties.id)
|
favourite?.setData(selected.properties.id)
|
||||||
}))
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
let rasterLayerOnMap = UIEventSource.feedFrom(rasterLayer)
|
let rasterLayerOnMap = UIEventSource.feedFrom(rasterLayer)
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
import BackButton from "../../Base/BackButton.svelte";
|
import BackButton from "../../Base/BackButton.svelte";
|
||||||
import ToSvelte from "../../Base/ToSvelte.svelte";
|
import ToSvelte from "../../Base/ToSvelte.svelte";
|
||||||
import Svg from "../../../Svg";
|
import Svg from "../../../Svg";
|
||||||
import RasterLayerOverview from "../../Map/RasterLayerOverview.svelte";
|
import MapControlButton from "../../Base/MapControlButton.svelte";
|
||||||
|
import {Square3Stack3dIcon} from "@babeard/svelte-heroicons/solid";
|
||||||
|
|
||||||
export let coordinate: { lon: number, lat: number };
|
export let coordinate: { lon: number, lat: number };
|
||||||
export let state: SpecialVisualizationState;
|
export let state: SpecialVisualizationState;
|
||||||
|
@ -197,7 +198,8 @@
|
||||||
<EyeOffIcon class="w-12"/>
|
<EyeOffIcon class="w-12"/>
|
||||||
<Tr t={Translations.t.general.add.disableFilters}/>
|
<Tr t={Translations.t.general.add.disableFilters}/>
|
||||||
</button>
|
</button>
|
||||||
<button class="flex w-full gap-x-1" on:click={() => {abort();state.guistate.openFilterView(selectedPreset.layer)}}>
|
<button class="flex w-full gap-x-1"
|
||||||
|
on:click={() => {abort();state.guistate.openFilterView(selectedPreset.layer)}}>
|
||||||
<ToSvelte construct={Svg.layers_svg().SetClass("w-12")}/>
|
<ToSvelte construct={Svg.layers_svg().SetClass("w-12")}/>
|
||||||
<Tr t={Translations.t.general.add.openLayerControl}/>
|
<Tr t={Translations.t.general.add.openLayerControl}/>
|
||||||
</button>
|
</button>
|
||||||
|
@ -263,11 +265,16 @@
|
||||||
<Tr slot="message" t={Translations.t.general.cancel}/>
|
<Tr slot="message" t={Translations.t.general.cancel}/>
|
||||||
</SubtleButton>
|
</SubtleButton>
|
||||||
{:else if !creating}
|
{:else if !creating}
|
||||||
<div class="w-full p-1">
|
<div class="relative w-full p-1">
|
||||||
<div class="w-full h-96 max-h-screen rounded-xl overflow-hidden">
|
<div class="w-full h-96 max-h-screen rounded-xl overflow-hidden">
|
||||||
<NewPointLocationInput value={preciseCoordinate} snappedTo={snappedToObject} {state} {coordinate}
|
<NewPointLocationInput value={preciseCoordinate} snappedTo={snappedToObject} {state} {coordinate}
|
||||||
targetLayer={selectedPreset.layer}
|
targetLayer={selectedPreset.layer}
|
||||||
snapToLayers={selectedPreset.preset.preciseInput.snapToLayers}/>
|
snapToLayers={selectedPreset.preset.preciseInput.snapToLayers}/>
|
||||||
|
</div>
|
||||||
|
<div class="absolute bottom-0 left-0 p-4">
|
||||||
|
<MapControlButton on:click={() => state.guistate.backgroundLayerSelectionIsOpened.setData(true)}>
|
||||||
|
<Square3Stack3dIcon class="w-6 h-6"/>
|
||||||
|
</MapControlButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap-reverse md:flex-nowrap">
|
<div class="flex flex-wrap-reverse md:flex-nowrap">
|
||||||
|
@ -282,9 +289,7 @@
|
||||||
</div>
|
</div>
|
||||||
</NextButton>
|
</NextButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<RasterLayerOverview />
|
|
||||||
|
|
||||||
{:else}
|
{:else}
|
||||||
<Loading>Creating point...</Loading>
|
<Loading>Creating point...</Loading>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import LayerConfig from "../Models/ThemeConfig/LayerConfig";
|
||||||
import FeatureSwitchState from "../Logic/State/FeatureSwitchState";
|
import FeatureSwitchState from "../Logic/State/FeatureSwitchState";
|
||||||
import { MenuState } from "../Models/MenuState";
|
import { MenuState } from "../Models/MenuState";
|
||||||
import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader";
|
import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader";
|
||||||
|
import {RasterLayerPolygon} from "../Models/RasterLayers";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The state needed to render a special Visualisation.
|
* The state needed to render a special Visualisation.
|
||||||
|
@ -69,6 +70,8 @@ export interface SpecialVisualizationState {
|
||||||
readonly preferencesAsTags: Store<Record<string, string>>
|
readonly preferencesAsTags: Store<Record<string, string>>
|
||||||
}
|
}
|
||||||
readonly lastClickObject: WritableFeatureSource
|
readonly lastClickObject: WritableFeatureSource
|
||||||
|
|
||||||
|
readonly availableLayers: Store<RasterLayerPolygon[]>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SpecialVisualization {
|
export interface SpecialVisualization {
|
||||||
|
|
Loading…
Reference in a new issue