forked from MapComplete/MapComplete
Fix: fix multi-visualisation
This commit is contained in:
parent
aa89d4120c
commit
872e36dffa
1 changed files with 11 additions and 8 deletions
|
@ -3,11 +3,7 @@ import { FixedUiElement } from "./Base/FixedUiElement"
|
||||||
import BaseUIElement from "./BaseUIElement"
|
import BaseUIElement from "./BaseUIElement"
|
||||||
import Title from "./Base/Title"
|
import Title from "./Base/Title"
|
||||||
import Table from "./Base/Table"
|
import Table from "./Base/Table"
|
||||||
import {
|
import { RenderingSpecification, SpecialVisualization, SpecialVisualizationState } from "./SpecialVisualization"
|
||||||
RenderingSpecification,
|
|
||||||
SpecialVisualization,
|
|
||||||
SpecialVisualizationState,
|
|
||||||
} from "./SpecialVisualization"
|
|
||||||
import { HistogramViz } from "./Popup/HistogramViz"
|
import { HistogramViz } from "./Popup/HistogramViz"
|
||||||
import { MinimapViz } from "./Popup/MinimapViz"
|
import { MinimapViz } from "./Popup/MinimapViz"
|
||||||
import { ShareLinkViz } from "./Popup/ShareLinkViz"
|
import { ShareLinkViz } from "./Popup/ShareLinkViz"
|
||||||
|
@ -18,7 +14,7 @@ import { PlantNetDetectionViz } from "./Popup/PlantNetDetectionViz"
|
||||||
import TagApplyButton from "./Popup/TagApplyButton"
|
import TagApplyButton from "./Popup/TagApplyButton"
|
||||||
import { CloseNoteButton } from "./Popup/Notes/CloseNoteButton"
|
import { CloseNoteButton } from "./Popup/Notes/CloseNoteButton"
|
||||||
import { MapillaryLinkVis } from "./Popup/MapillaryLinkVis"
|
import { MapillaryLinkVis } from "./Popup/MapillaryLinkVis"
|
||||||
import { Store, Stores, UIEventSource } from "../Logic/UIEventSource"
|
import { ImmutableStore, Store, Stores, UIEventSource } from "../Logic/UIEventSource"
|
||||||
import AllTagsPanel from "./Popup/AllTagsPanel.svelte"
|
import AllTagsPanel from "./Popup/AllTagsPanel.svelte"
|
||||||
import AllImageProviders from "../Logic/ImageProviders/AllImageProviders"
|
import AllImageProviders from "../Logic/ImageProviders/AllImageProviders"
|
||||||
import { ImageCarousel } from "./Image/ImageCarousel"
|
import { ImageCarousel } from "./Image/ImageCarousel"
|
||||||
|
@ -1257,12 +1253,19 @@ export default class SpecialVisualizations {
|
||||||
const translation = new Translation({ "*": tr })
|
const translation = new Translation({ "*": tr })
|
||||||
return new VariableUiElement(
|
return new VariableUiElement(
|
||||||
featureTags.map((tags) => {
|
featureTags.map((tags) => {
|
||||||
const properties: object[] = JSON.parse(tags[key])
|
console.log("Trying to parse", tags[key], key)
|
||||||
|
let properties: object[]
|
||||||
|
if(typeof tags[key] === "string"){
|
||||||
|
properties =JSON.parse(tags[key])
|
||||||
|
}else{
|
||||||
|
properties = <any> tags[key]
|
||||||
|
console.log("Multi properties are", properties)
|
||||||
|
}
|
||||||
const elements = []
|
const elements = []
|
||||||
for (const property of properties) {
|
for (const property of properties) {
|
||||||
const subsTr = new SvelteUIElement(SpecialTranslation, {
|
const subsTr = new SvelteUIElement(SpecialTranslation, {
|
||||||
t: translation,
|
t: translation,
|
||||||
tags: properties,
|
tags: new ImmutableStore(property),
|
||||||
state,
|
state,
|
||||||
feature,
|
feature,
|
||||||
layer,
|
layer,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue