diff --git a/assets/svg/center.svg.license b/assets/svg/center.svg.license index 2452bee1e..ed0288300 100644 --- a/assets/svg/center.svg.license +++ b/assets/svg/center.svg.license @@ -1,2 +1,2 @@ SPDX-FileCopyrightText: Pieter Vander Vennet -SPDX-License-Identifier: CC0 \ No newline at end of file +SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/public/css/index-tailwind-output.css b/public/css/index-tailwind-output.css index d66b0bb91..f4040f97d 100644 --- a/public/css/index-tailwind-output.css +++ b/public/css/index-tailwind-output.css @@ -841,10 +841,6 @@ video { margin-right: 3rem; } -.mb-4 { - margin-bottom: 1rem; -} - .mt-4 { margin-top: 1rem; } @@ -881,6 +877,10 @@ video { margin-right: 0.25rem; } +.mb-4 { + margin-bottom: 1rem; +} + .ml-1 { margin-left: 0.25rem; } diff --git a/src/Logic/FeatureSource/Sources/FavouritesFeatureSource.ts b/src/Logic/FeatureSource/Sources/FavouritesFeatureSource.ts index 01703987f..1a4c37df2 100644 --- a/src/Logic/FeatureSource/Sources/FavouritesFeatureSource.ts +++ b/src/Logic/FeatureSource/Sources/FavouritesFeatureSource.ts @@ -109,7 +109,7 @@ export default class FavouritesFeatureSource extends StaticFeatureSource { if (!key.startsWith(FavouritesFeatureSource.prefix + id)) { continue } - const propertyName = key.substring(minLength) + const propertyName = key.substring(minLength).replaceAll("__", ":") properties[propertyName] = prefs[key] } return properties diff --git a/src/UI/Favourites/FavouriteSummary.svelte b/src/UI/Favourites/FavouriteSummary.svelte index fc23cbbb9..c890f5a59 100644 --- a/src/UI/Favourites/FavouriteSummary.svelte +++ b/src/UI/Favourites/FavouriteSummary.svelte @@ -6,6 +6,7 @@ import { ImmutableStore } from "../../Logic/UIEventSource"; import { GeoOperations } from "../../Logic/GeoOperations"; import Center from "../../assets/svg/Center.svelte"; + import { Utils } from "../../Utils"; export let feature: Feature; let properties: Record = feature.properties; @@ -30,15 +31,31 @@ center() } + const coord = GeoOperations.centerpointCoordinates(feature) + const distance = state.mapProperties.location.stabilized(500).mapD(({lon, lat}) => { + let meters = Math.round(GeoOperations.distanceBetween(coord, [lon, lat])) + + if(meters < 1000){ + return meters +"m" + } + + meters = Math.round(meters / 100) + const kmStr = ""+meters + + + return kmStr.substring(0, kmStr.length - 1)+"."+kmStr.substring(kmStr.length-1) +"km" + }) const titleIconBlacklist = ["osmlink","sharelink","favourite_title_icon"]

select()} class="cursor-pointer ml-1 m-0"> - +

+ {$distance} +
{#each favConfig.titleIcons as titleIconConfig} {#if (titleIconBlacklist.indexOf(titleIconConfig.id) < 0) && (titleIconConfig.condition?.matchesProperties(properties) ?? true) && (titleIconConfig.metacondition?.matchesProperties( { ...properties, ...state.userRelatedState.preferencesAsTags.data } ) ?? true) && titleIconConfig.IsKnown(properties)} diff --git a/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte b/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte index ab918974e..037021e73 100644 --- a/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingQuestion.svelte @@ -140,7 +140,7 @@ console.log("SelectedTags is undefined, ignoring 'onSave'-event") return } - if (layer === undefined || layer?.source === null) { + if (layer === undefined || (layer?.source === null && layer.id !== "favourite")) { /** * This is a special, priviliged layer. * We simply apply the tags onto the records @@ -159,7 +159,7 @@ dispatch("saved", { config, applied: selectedTags }) const change = new ChangeTagAction(tags.data.id, selectedTags, tags.data, { - theme: state.layout.id, + theme: tags.data["_orig_theme"] ?? state.layout.id, changeType: "answer", }) freeformInput.setData(undefined) diff --git a/src/UI/Studio/EditItemButton.svelte b/src/UI/Studio/EditItemButton.svelte index 3d593f0a1..aaa59b397 100644 --- a/src/UI/Studio/EditItemButton.svelte +++ b/src/UI/Studio/EditItemButton.svelte @@ -1,29 +1,30 @@ dispatch("layerSelected", info)}> @@ -32,6 +33,12 @@
{info.id} {#if info.owner && info.owner !== $selfId} - (made by {$displayName ?? info.owner}) + {#if displayName} + (made by {$displayName} + {#if window.location.host.startsWith("127.0.0.1")} + - {info.owner} + {/if} + ) + {/if} {/if}