forked from MapComplete/MapComplete
Fix: fix crash in GRB theme when replacing geometry
This commit is contained in:
parent
046e7d801f
commit
3c5a528307
1 changed files with 7 additions and 6 deletions
|
@ -1,7 +1,6 @@
|
|||
<script lang="ts">
|
||||
import Loading from "../Base/Loading.svelte"
|
||||
import MaplibreMap from "../Map/MaplibreMap.svelte"
|
||||
import { Utils } from "../../Utils"
|
||||
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||
import FilteredLayer from "../../Models/FilteredLayer"
|
||||
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig"
|
||||
|
@ -13,6 +12,8 @@
|
|||
import type { AutoAction } from "./AutoApplyButtonVis"
|
||||
import Tr from "../Base/Tr.svelte"
|
||||
import Translations from "../i18n/Translations"
|
||||
import { Lists } from "../../Utils/Lists"
|
||||
import type { OsmFeature } from "../../Models/OsmFeature"
|
||||
|
||||
/**
|
||||
* The ids to handle. Might be data from an external dataset, we cannot assume an OSM-id
|
||||
|
@ -42,12 +43,12 @@
|
|||
mla.allowZooming.setData(false)
|
||||
mla.allowMoving.setData(false)
|
||||
|
||||
const features = ids.mapD((ids) =>
|
||||
ids.map((id) => state.indexedFeatures.featuresById.data.get(id))
|
||||
const features: Store<OsmFeature[]> = ids.mapD((ids) =>
|
||||
ids.map<OsmFeature>((id) => state.indexedFeatures.featuresById.data.get(id))
|
||||
)
|
||||
|
||||
new ShowDataLayer(mlmap, {
|
||||
features: StaticFeatureSource.fromGeojson(features),
|
||||
features: new StaticFeatureSource(features),
|
||||
zoomToFeatures: true,
|
||||
layer: layer.layerDef,
|
||||
})
|
||||
|
@ -121,10 +122,10 @@
|
|||
<div class="alert">Target tagrendering {options.targetTagRendering} not found"</div>
|
||||
{:else if $ids.length === 0}
|
||||
<div>No elements found to perform action</div>
|
||||
{:else if $buttonState.error !== undefined}
|
||||
{:else if $buttonState["error"] !== undefined}
|
||||
<div class="flex flex-col">
|
||||
<div class="alert">Something went wrong</div>
|
||||
<div>{$buttonState.error}</div>
|
||||
<div>{$buttonState["error"]}</div>
|
||||
</div>
|
||||
{:else if $buttonState === "done"}
|
||||
<div class="thanks">All done!</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue