forked from MapComplete/MapComplete
Merge branch 'master' into develop
This commit is contained in:
commit
7c6ebc959c
161 changed files with 11056 additions and 2506 deletions
|
@ -331,9 +331,9 @@ export class GeoOperations {
|
|||
const lines: string[] = []
|
||||
|
||||
let _features
|
||||
if(Array.isArray(features)){
|
||||
if (Array.isArray(features)) {
|
||||
_features = features
|
||||
}else{
|
||||
} else {
|
||||
_features = features.features
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,11 @@ export class ImageUploadManager {
|
|||
* @param tagsStore The tags of the feature
|
||||
* @param targetKey Use this key to save the attribute under. Default: 'image'
|
||||
*/
|
||||
public async uploadImageAndApply(file: File, tagsStore: UIEventSource<OsmTags>, targetKey?: string): Promise<void> {
|
||||
public async uploadImageAndApply(
|
||||
file: File,
|
||||
tagsStore: UIEventSource<OsmTags>,
|
||||
targetKey?: string
|
||||
): Promise<void> {
|
||||
const sizeInBytes = file.size
|
||||
const tags = tagsStore.data
|
||||
const featureId = <OsmId>tags.id
|
||||
|
@ -98,7 +102,13 @@ export class ImageUploadManager {
|
|||
].join("\n")
|
||||
|
||||
console.log("Upload done, creating ")
|
||||
const action = await this.uploadImageWithLicense(featureId, title, description, file, targetKey)
|
||||
const action = await this.uploadImageWithLicense(
|
||||
featureId,
|
||||
title,
|
||||
description,
|
||||
file,
|
||||
targetKey
|
||||
)
|
||||
if (!isNaN(Number(featureId))) {
|
||||
// This is a map note
|
||||
const url = action._url
|
||||
|
|
|
@ -72,7 +72,10 @@ export class OsmPreferences {
|
|||
let i = 0
|
||||
while (str !== "") {
|
||||
if (str === undefined || str === "undefined") {
|
||||
throw "Got 'undefined' or a literal string containing 'undefined' for a long preference with name "+key
|
||||
throw (
|
||||
"Got 'undefined' or a literal string containing 'undefined' for a long preference with name " +
|
||||
key
|
||||
)
|
||||
}
|
||||
if (i > 100) {
|
||||
throw "This long preference is getting very long... "
|
||||
|
|
|
@ -76,9 +76,12 @@ export default class FeatureSwitchState extends OsmConnectionFeatureSwitches {
|
|||
"Disables/Enables logging in and thus disables editing all together. This effectively puts MapComplete into read-only mode."
|
||||
)
|
||||
{
|
||||
if(QueryParameters.wasInitialized("fs-userbadge")){
|
||||
if (QueryParameters.wasInitialized("fs-userbadge")) {
|
||||
// userbadge is the legacy name for 'enable-login'
|
||||
this.featureSwitchEnableLogin.setData(QueryParameters.GetBooleanQueryParameter("fs-userbadge", undefined, "Legacy").data)
|
||||
this.featureSwitchEnableLogin.setData(
|
||||
QueryParameters.GetBooleanQueryParameter("fs-userbadge", undefined, "Legacy")
|
||||
.data
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,8 +102,8 @@ export class GeoLocationState {
|
|||
this.requestPermissionAsync()
|
||||
}
|
||||
|
||||
public static isSafari(): boolean{
|
||||
return navigator.permissions === undefined && navigator.geolocation !== undefined
|
||||
public static isSafari(): boolean {
|
||||
return navigator.permissions === undefined && navigator.geolocation !== undefined
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,19 +15,19 @@
|
|||
export let userDetails: UIEventSource<UserDetails>
|
||||
export let state: { layoutToUse?: { id: string }; osmConnection: OsmConnection }
|
||||
export let selected: boolean = false
|
||||
|
||||
|
||||
let unlockedPersonal = LocalStorageSource.GetParsed("unlocked_personal_theme", false)
|
||||
|
||||
userDetails.addCallbackAndRunD(userDetails => {
|
||||
if(!userDetails.loggedIn){
|
||||
return
|
||||
}
|
||||
if(userDetails.csCount > Constants.userJourney.personalLayoutUnlock){
|
||||
unlockedPersonal.setData(true)
|
||||
}
|
||||
return true
|
||||
userDetails.addCallbackAndRunD((userDetails) => {
|
||||
if (!userDetails.loggedIn) {
|
||||
return
|
||||
}
|
||||
if (userDetails.csCount > Constants.userJourney.personalLayoutUnlock) {
|
||||
unlockedPersonal.setData(true)
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
|
||||
$: title = new Translation(
|
||||
theme.title,
|
||||
!isCustom && !theme.mustHaveLanguage ? "themes:" + theme.id + ".title" : undefined
|
||||
|
|
|
@ -1,51 +1,51 @@
|
|||
<script lang="ts">
|
||||
import Translations from "../i18n/Translations"
|
||||
import Svg from "../../Svg"
|
||||
import Tr from "../Base/Tr.svelte"
|
||||
import NextButton from "../Base/NextButton.svelte"
|
||||
import Geosearch from "./Geosearch.svelte"
|
||||
import ToSvelte from "../Base/ToSvelte.svelte"
|
||||
import ThemeViewState from "../../Models/ThemeViewState"
|
||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
||||
import { SearchIcon } from "@rgossiaux/svelte-heroicons/solid"
|
||||
import { twJoin } from "tailwind-merge"
|
||||
import { Utils } from "../../Utils"
|
||||
import type { GeolocationPermissionState } from "../../Logic/State/GeoLocationState"
|
||||
import { GeoLocationState } from "../../Logic/State/GeoLocationState"
|
||||
import If from "../Base/If.svelte"
|
||||
import { ExclamationTriangleIcon } from "@babeard/svelte-heroicons/mini"
|
||||
import type { Readable } from "svelte/store"
|
||||
import Translations from "../i18n/Translations"
|
||||
import Svg from "../../Svg"
|
||||
import Tr from "../Base/Tr.svelte"
|
||||
import NextButton from "../Base/NextButton.svelte"
|
||||
import Geosearch from "./Geosearch.svelte"
|
||||
import ToSvelte from "../Base/ToSvelte.svelte"
|
||||
import ThemeViewState from "../../Models/ThemeViewState"
|
||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
||||
import { SearchIcon } from "@rgossiaux/svelte-heroicons/solid"
|
||||
import { twJoin } from "tailwind-merge"
|
||||
import { Utils } from "../../Utils"
|
||||
import type { GeolocationPermissionState } from "../../Logic/State/GeoLocationState"
|
||||
import { GeoLocationState } from "../../Logic/State/GeoLocationState"
|
||||
import If from "../Base/If.svelte"
|
||||
import { ExclamationTriangleIcon } from "@babeard/svelte-heroicons/mini"
|
||||
import type { Readable } from "svelte/store"
|
||||
|
||||
/**
|
||||
* The theme introduction panel
|
||||
*/
|
||||
export let state: ThemeViewState
|
||||
let layout = state.layout
|
||||
let selectedElement = state.selectedElement
|
||||
let selectedLayer = state.selectedLayer
|
||||
/**
|
||||
* The theme introduction panel
|
||||
*/
|
||||
export let state: ThemeViewState
|
||||
let layout = state.layout
|
||||
let selectedElement = state.selectedElement
|
||||
let selectedLayer = state.selectedLayer
|
||||
|
||||
let triggerSearch: UIEventSource<any> = new UIEventSource<any>(undefined)
|
||||
let searchEnabled = false
|
||||
let triggerSearch: UIEventSource<any> = new UIEventSource<any>(undefined)
|
||||
let searchEnabled = false
|
||||
|
||||
let geopermission: Readable<GeolocationPermissionState> =
|
||||
state.geolocation.geolocationState.permission
|
||||
let currentGPSLocation = state.geolocation.geolocationState.currentGPSLocation
|
||||
let geopermission: Readable<GeolocationPermissionState> =
|
||||
state.geolocation.geolocationState.permission
|
||||
let currentGPSLocation = state.geolocation.geolocationState.currentGPSLocation
|
||||
|
||||
geopermission.addCallback((perm) => console.log(">>>> Permission", perm))
|
||||
geopermission.addCallback((perm) => console.log(">>>> Permission", perm))
|
||||
|
||||
function jumpToCurrentLocation() {
|
||||
const glstate = state.geolocation.geolocationState
|
||||
if (glstate.currentGPSLocation.data !== undefined) {
|
||||
const c: GeolocationCoordinates = glstate.currentGPSLocation.data
|
||||
state.guistate.themeIsOpened.setData(false)
|
||||
const coor = { lon: c.longitude, lat: c.latitude }
|
||||
state.mapProperties.location.setData(coor)
|
||||
}
|
||||
if (glstate.permission.data !== "granted") {
|
||||
glstate.requestPermission()
|
||||
return
|
||||
}
|
||||
function jumpToCurrentLocation() {
|
||||
const glstate = state.geolocation.geolocationState
|
||||
if (glstate.currentGPSLocation.data !== undefined) {
|
||||
const c: GeolocationCoordinates = glstate.currentGPSLocation.data
|
||||
state.guistate.themeIsOpened.setData(false)
|
||||
const coor = { lon: c.longitude, lat: c.latitude }
|
||||
state.mapProperties.location.setData(coor)
|
||||
}
|
||||
if (glstate.permission.data !== "granted") {
|
||||
glstate.requestPermission()
|
||||
return
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex h-full flex-col justify-between">
|
||||
|
@ -87,7 +87,6 @@
|
|||
/>
|
||||
<Tr t={Translations.t.general.waitingForGeopermission} />
|
||||
</button>
|
||||
|
||||
{:else if $geopermission === "denied"}
|
||||
<button class="disabled flex w-full items-center gap-x-2">
|
||||
<ToSvelte construct={Svg.location_refused_svg().SetClass("w-8 h-8")} />
|
||||
|
@ -107,7 +106,7 @@
|
|||
|
||||
<If condition={state.featureSwitches.featureSwitchSearch}>
|
||||
<div
|
||||
class=".button low-interaction m-1 flex w-full items-center gap-x-2 rounded border p-2 h-fit"
|
||||
class=".button low-interaction m-1 flex h-fit w-full items-center gap-x-2 rounded border p-2"
|
||||
>
|
||||
<div class="w-full">
|
||||
<Geosearch
|
||||
|
@ -137,8 +136,13 @@
|
|||
</div>
|
||||
|
||||
{#if $currentGPSLocation === undefined && $geopermission === "requested" && GeoLocationState.isSafari()}
|
||||
<a href="https://support.apple.com/en-us/HT207092" class="button w-full" target="_blank" rel="noopener">
|
||||
<div class="flex w-full link-underline m-1">
|
||||
<a
|
||||
href="https://support.apple.com/en-us/HT207092"
|
||||
class="button w-full"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
<div class="link-underline m-1 flex w-full">
|
||||
<ExclamationTriangleIcon class="w-12 pr-2" />
|
||||
<div class="flex w-full flex-col">
|
||||
<Tr cls="font-normal" t={Translations.t.general.enableGeolocationForSafari} />
|
||||
|
@ -147,7 +151,6 @@
|
|||
</div>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="links-as-button links-w-full m-2 flex flex-col gap-y-1">
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<script lang="ts">/**
|
||||
* Opens the 'Opening hours input' in another top level window
|
||||
*/
|
||||
import { UIEventSource } from "../../../Logic/UIEventSource"
|
||||
import ToSvelte from "../../Base/ToSvelte.svelte"
|
||||
import OpeningHoursInput from "../../OpeningHours/OpeningHoursInput"
|
||||
<script lang="ts">
|
||||
/**
|
||||
* Opens the 'Opening hours input' in another top level window
|
||||
*/
|
||||
import { UIEventSource } from "../../../Logic/UIEventSource"
|
||||
import ToSvelte from "../../Base/ToSvelte.svelte"
|
||||
import OpeningHoursInput from "../../OpeningHours/OpeningHoursInput"
|
||||
|
||||
export let value: UIEventSource<string>
|
||||
export let value: UIEventSource<string>
|
||||
</script>
|
||||
|
||||
<ToSvelte construct={new OpeningHoursInput(value)}></ToSvelte>
|
||||
<ToSvelte construct={new OpeningHoursInput(value)} />
|
||||
|
|
|
@ -53,7 +53,7 @@ export default class InputHelpers {
|
|||
}),
|
||||
date: (value) => new SvelteUIElement(DateInput, { value }),
|
||||
color: (value) => new SvelteUIElement(ColorInput, { value }),
|
||||
opening_hours: (value) => new SvelteUIElement(OpeningHoursInput, {value}),
|
||||
opening_hours: (value) => new SvelteUIElement(OpeningHoursInput, { value }),
|
||||
wikidata: InputHelpers.constructWikidataHelper,
|
||||
} as const
|
||||
|
||||
|
|
|
@ -1,30 +1,34 @@
|
|||
<script lang="ts">
|
||||
import { Utils } from "../Utils"
|
||||
import { Store, UIEventSource } from "../Logic/UIEventSource"
|
||||
import Loading from "./Base/Loading.svelte"
|
||||
import { OsmConnection } from "../Logic/Osm/OsmConnection"
|
||||
|
||||
import { Utils } from "../Utils"
|
||||
import { Store, UIEventSource } from "../Logic/UIEventSource"
|
||||
import Loading from "./Base/Loading.svelte"
|
||||
import { OsmConnection } from "../Logic/Osm/OsmConnection"
|
||||
|
||||
const osmConnection = new OsmConnection({
|
||||
attemptLogin: true
|
||||
})
|
||||
let loggedInContributor: Store<string> = osmConnection.userDetails.map(ud => ud.name)
|
||||
export let source = "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/picture-leaderboard.json"
|
||||
let data: Store<undefined | {
|
||||
const osmConnection = new OsmConnection({
|
||||
attemptLogin: true,
|
||||
})
|
||||
let loggedInContributor: Store<string> = osmConnection.userDetails.map((ud) => ud.name)
|
||||
export let source =
|
||||
"https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/picture-leaderboard.json"
|
||||
let data: Store<
|
||||
| undefined
|
||||
| {
|
||||
leaderboard: {
|
||||
rank: number,
|
||||
name: string,
|
||||
account: string,
|
||||
nrOfImages: number
|
||||
}[],
|
||||
median: number,
|
||||
totalAuthors: number,
|
||||
rank: number
|
||||
name: string
|
||||
account: string
|
||||
nrOfImages: number
|
||||
}[]
|
||||
median: number
|
||||
totalAuthors: number
|
||||
byLicense: {
|
||||
license: string, total: number, authors: string[]
|
||||
},
|
||||
license: string
|
||||
total: number
|
||||
authors: string[]
|
||||
}
|
||||
date: string
|
||||
}> = UIEventSource.FromPromise(Utils.downloadJsonCached(source))
|
||||
|
||||
}
|
||||
> = UIEventSource.FromPromise(Utils.downloadJsonCached(source))
|
||||
</script>
|
||||
|
||||
<h1>Contributed images with MapComplete: leaderboard</h1>
|
||||
|
@ -43,13 +47,14 @@
|
|||
</td>
|
||||
<td>
|
||||
{#if $loggedInContributor === contributor.name}
|
||||
<a class="thanks" href="{contributor.account}">{contributor.name}</a>
|
||||
<a class="thanks" href={contributor.account}>{contributor.name}</a>
|
||||
{:else}
|
||||
<a href="{contributor.account}">{contributor.name}</a>
|
||||
<a href={contributor.account}>{contributor.name}</a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<b>{contributor.nrOfImages}</b> total images
|
||||
<b>{contributor.nrOfImages}</b>
|
||||
total images
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{#if $userDetails.loggedIn}
|
||||
<div>
|
||||
{#if tags === undefined}
|
||||
<slot name="no-tags"><Tr cls="subtle" t={Translations.t.general.noTagsSelected}></Tr></slot>
|
||||
<slot name="no-tags"><Tr cls="subtle" t={Translations.t.general.noTagsSelected} /></slot>
|
||||
{:else if embedIn === undefined}
|
||||
<FromHtml src={tagsExplanation} />
|
||||
{:else}
|
||||
|
|
|
@ -178,31 +178,39 @@
|
|||
</script>
|
||||
|
||||
{#if config.question !== undefined}
|
||||
<div class="interactive border-interactive flex flex-col p-1 px-2 relative overflow-y-auto" style="max-height: 85vh">
|
||||
<div
|
||||
class="interactive border-interactive relative flex flex-col overflow-y-auto p-1 px-2"
|
||||
style="max-height: 85vh"
|
||||
>
|
||||
<div class="sticky top-0" style="z-index: 11">
|
||||
|
||||
<div class="flex justify-between sticky top-0 interactive">
|
||||
<span class="font-bold">
|
||||
<SpecialTranslation t={config.question} {tags} {state} {layer} feature={selectedElement} />
|
||||
</span>
|
||||
<slot name="upper-right" />
|
||||
</div>
|
||||
|
||||
{#if config.questionhint}
|
||||
<div>
|
||||
<SpecialTranslation
|
||||
t={config.questionhint}
|
||||
{tags}
|
||||
{state}
|
||||
{layer}
|
||||
feature={selectedElement}
|
||||
/>
|
||||
<div class="interactive sticky top-0 flex justify-between">
|
||||
<span class="font-bold">
|
||||
<SpecialTranslation
|
||||
t={config.question}
|
||||
{tags}
|
||||
{state}
|
||||
{layer}
|
||||
feature={selectedElement}
|
||||
/>
|
||||
</span>
|
||||
<slot name="upper-right" />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if config.questionhint}
|
||||
<div>
|
||||
<SpecialTranslation
|
||||
t={config.questionhint}
|
||||
{tags}
|
||||
{state}
|
||||
{layer}
|
||||
feature={selectedElement}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if config.mappings?.length >= 8}
|
||||
<div class="flex w-full sticky">
|
||||
<div class="sticky flex w-full">
|
||||
<img src="./assets/svg/search.svg" class="h-6 w-6" />
|
||||
<input type="text" bind:value={$searchTerm} class="w-full" />
|
||||
</div>
|
||||
|
@ -312,7 +320,10 @@
|
|||
<Tr t={$feedback} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="flex flex-wrap-reverse items-stretch justify-end sm:flex-nowrap sticky bottom-0 interactive" style="z-index: 11">
|
||||
<div
|
||||
class="interactive sticky bottom-0 flex flex-wrap-reverse items-stretch justify-end sm:flex-nowrap"
|
||||
style="z-index: 11"
|
||||
>
|
||||
<!-- TagRenderingQuestion-buttons -->
|
||||
<slot name="cancel" />
|
||||
<slot name="save-button" {selectedTags}>
|
||||
|
|
|
@ -1,115 +1,115 @@
|
|||
<script lang="ts">
|
||||
import { Store, UIEventSource } from "../Logic/UIEventSource"
|
||||
import { Map as MlMap } from "maplibre-gl"
|
||||
import MaplibreMap from "./Map/MaplibreMap.svelte"
|
||||
import FeatureSwitchState from "../Logic/State/FeatureSwitchState"
|
||||
import MapControlButton from "./Base/MapControlButton.svelte"
|
||||
import ToSvelte from "./Base/ToSvelte.svelte"
|
||||
import If from "./Base/If.svelte"
|
||||
import { GeolocationControl } from "./BigComponents/GeolocationControl"
|
||||
import type { Feature } from "geojson"
|
||||
import SelectedElementView from "./BigComponents/SelectedElementView.svelte"
|
||||
import LayerConfig from "../Models/ThemeConfig/LayerConfig"
|
||||
import Filterview from "./BigComponents/Filterview.svelte"
|
||||
import ThemeViewState from "../Models/ThemeViewState"
|
||||
import type { MapProperties } from "../Models/MapProperties"
|
||||
import Geosearch from "./BigComponents/Geosearch.svelte"
|
||||
import Translations from "./i18n/Translations"
|
||||
import { CogIcon, EyeIcon, MenuIcon, XCircleIcon } from "@rgossiaux/svelte-heroicons/solid"
|
||||
import Tr from "./Base/Tr.svelte"
|
||||
import CommunityIndexView from "./BigComponents/CommunityIndexView.svelte"
|
||||
import FloatOver from "./Base/FloatOver.svelte"
|
||||
import PrivacyPolicy from "./BigComponents/PrivacyPolicy"
|
||||
import Constants from "../Models/Constants"
|
||||
import TabbedGroup from "./Base/TabbedGroup.svelte"
|
||||
import UserRelatedState from "../Logic/State/UserRelatedState"
|
||||
import LoginToggle from "./Base/LoginToggle.svelte"
|
||||
import LoginButton from "./Base/LoginButton.svelte"
|
||||
import CopyrightPanel from "./BigComponents/CopyrightPanel"
|
||||
import DownloadPanel from "./DownloadFlow/DownloadPanel.svelte"
|
||||
import ModalRight from "./Base/ModalRight.svelte"
|
||||
import { Utils } from "../Utils"
|
||||
import Hotkeys from "./Base/Hotkeys"
|
||||
import { VariableUiElement } from "./Base/VariableUIElement"
|
||||
import SvelteUIElement from "./Base/SvelteUIElement"
|
||||
import OverlayToggle from "./BigComponents/OverlayToggle.svelte"
|
||||
import LevelSelector from "./BigComponents/LevelSelector.svelte"
|
||||
import ExtraLinkButton from "./BigComponents/ExtraLinkButton"
|
||||
import SelectedElementTitle from "./BigComponents/SelectedElementTitle.svelte"
|
||||
import Svg from "../Svg"
|
||||
import ThemeIntroPanel from "./BigComponents/ThemeIntroPanel.svelte"
|
||||
import type { RasterLayerPolygon } from "../Models/RasterLayers"
|
||||
import { AvailableRasterLayers } from "../Models/RasterLayers"
|
||||
import RasterLayerOverview from "./Map/RasterLayerOverview.svelte"
|
||||
import IfHidden from "./Base/IfHidden.svelte"
|
||||
import { onDestroy } from "svelte"
|
||||
import { OpenJosm } from "./BigComponents/OpenJosm"
|
||||
import MapillaryLink from "./BigComponents/MapillaryLink.svelte"
|
||||
import OpenIdEditor from "./BigComponents/OpenIdEditor.svelte"
|
||||
import OpenBackgroundSelectorButton from "./BigComponents/OpenBackgroundSelectorButton.svelte"
|
||||
import StateIndicator from "./BigComponents/StateIndicator.svelte"
|
||||
import LanguagePicker from "./LanguagePicker"
|
||||
import Locale from "./i18n/Locale"
|
||||
import ShareScreen from "./BigComponents/ShareScreen.svelte"
|
||||
import UploadingImageCounter from "./Image/UploadingImageCounter.svelte"
|
||||
import PendingChangesIndicator from "./BigComponents/PendingChangesIndicator.svelte"
|
||||
import { Store, UIEventSource } from "../Logic/UIEventSource"
|
||||
import { Map as MlMap } from "maplibre-gl"
|
||||
import MaplibreMap from "./Map/MaplibreMap.svelte"
|
||||
import FeatureSwitchState from "../Logic/State/FeatureSwitchState"
|
||||
import MapControlButton from "./Base/MapControlButton.svelte"
|
||||
import ToSvelte from "./Base/ToSvelte.svelte"
|
||||
import If from "./Base/If.svelte"
|
||||
import { GeolocationControl } from "./BigComponents/GeolocationControl"
|
||||
import type { Feature } from "geojson"
|
||||
import SelectedElementView from "./BigComponents/SelectedElementView.svelte"
|
||||
import LayerConfig from "../Models/ThemeConfig/LayerConfig"
|
||||
import Filterview from "./BigComponents/Filterview.svelte"
|
||||
import ThemeViewState from "../Models/ThemeViewState"
|
||||
import type { MapProperties } from "../Models/MapProperties"
|
||||
import Geosearch from "./BigComponents/Geosearch.svelte"
|
||||
import Translations from "./i18n/Translations"
|
||||
import { CogIcon, EyeIcon, MenuIcon, XCircleIcon } from "@rgossiaux/svelte-heroicons/solid"
|
||||
import Tr from "./Base/Tr.svelte"
|
||||
import CommunityIndexView from "./BigComponents/CommunityIndexView.svelte"
|
||||
import FloatOver from "./Base/FloatOver.svelte"
|
||||
import PrivacyPolicy from "./BigComponents/PrivacyPolicy"
|
||||
import Constants from "../Models/Constants"
|
||||
import TabbedGroup from "./Base/TabbedGroup.svelte"
|
||||
import UserRelatedState from "../Logic/State/UserRelatedState"
|
||||
import LoginToggle from "./Base/LoginToggle.svelte"
|
||||
import LoginButton from "./Base/LoginButton.svelte"
|
||||
import CopyrightPanel from "./BigComponents/CopyrightPanel"
|
||||
import DownloadPanel from "./DownloadFlow/DownloadPanel.svelte"
|
||||
import ModalRight from "./Base/ModalRight.svelte"
|
||||
import { Utils } from "../Utils"
|
||||
import Hotkeys from "./Base/Hotkeys"
|
||||
import { VariableUiElement } from "./Base/VariableUIElement"
|
||||
import SvelteUIElement from "./Base/SvelteUIElement"
|
||||
import OverlayToggle from "./BigComponents/OverlayToggle.svelte"
|
||||
import LevelSelector from "./BigComponents/LevelSelector.svelte"
|
||||
import ExtraLinkButton from "./BigComponents/ExtraLinkButton"
|
||||
import SelectedElementTitle from "./BigComponents/SelectedElementTitle.svelte"
|
||||
import Svg from "../Svg"
|
||||
import ThemeIntroPanel from "./BigComponents/ThemeIntroPanel.svelte"
|
||||
import type { RasterLayerPolygon } from "../Models/RasterLayers"
|
||||
import { AvailableRasterLayers } from "../Models/RasterLayers"
|
||||
import RasterLayerOverview from "./Map/RasterLayerOverview.svelte"
|
||||
import IfHidden from "./Base/IfHidden.svelte"
|
||||
import { onDestroy } from "svelte"
|
||||
import { OpenJosm } from "./BigComponents/OpenJosm"
|
||||
import MapillaryLink from "./BigComponents/MapillaryLink.svelte"
|
||||
import OpenIdEditor from "./BigComponents/OpenIdEditor.svelte"
|
||||
import OpenBackgroundSelectorButton from "./BigComponents/OpenBackgroundSelectorButton.svelte"
|
||||
import StateIndicator from "./BigComponents/StateIndicator.svelte"
|
||||
import LanguagePicker from "./LanguagePicker"
|
||||
import Locale from "./i18n/Locale"
|
||||
import ShareScreen from "./BigComponents/ShareScreen.svelte"
|
||||
import UploadingImageCounter from "./Image/UploadingImageCounter.svelte"
|
||||
import PendingChangesIndicator from "./BigComponents/PendingChangesIndicator.svelte"
|
||||
|
||||
export let state: ThemeViewState
|
||||
let layout = state.layout
|
||||
export let state: ThemeViewState
|
||||
let layout = state.layout
|
||||
|
||||
let maplibremap: UIEventSource<MlMap> = state.map
|
||||
let selectedElement: UIEventSource<Feature> = state.selectedElement
|
||||
let selectedLayer: UIEventSource<LayerConfig> = state.selectedLayer
|
||||
let maplibremap: UIEventSource<MlMap> = state.map
|
||||
let selectedElement: UIEventSource<Feature> = state.selectedElement
|
||||
let selectedLayer: UIEventSource<LayerConfig> = state.selectedLayer
|
||||
|
||||
const selectedElementView = selectedElement.map(
|
||||
(selectedElement) => {
|
||||
// Svelte doesn't properly reload some of the legacy UI-elements
|
||||
// As such, we _reconstruct_ the selectedElementView every time a new feature is selected
|
||||
// This is a bit wasteful, but until everything is a svelte-component, this should do the trick
|
||||
const layer = selectedLayer.data
|
||||
if (selectedElement === undefined || layer === undefined) {
|
||||
return undefined
|
||||
}
|
||||
const selectedElementView = selectedElement.map(
|
||||
(selectedElement) => {
|
||||
// Svelte doesn't properly reload some of the legacy UI-elements
|
||||
// As such, we _reconstruct_ the selectedElementView every time a new feature is selected
|
||||
// This is a bit wasteful, but until everything is a svelte-component, this should do the trick
|
||||
const layer = selectedLayer.data
|
||||
if (selectedElement === undefined || layer === undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (!(layer.tagRenderings?.length > 0) || layer.title === undefined) {
|
||||
return undefined
|
||||
}
|
||||
if (!(layer.tagRenderings?.length > 0) || layer.title === undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const tags = state.featureProperties.getStore(selectedElement.properties.id)
|
||||
return new SvelteUIElement(SelectedElementView, { state, layer, selectedElement, tags })
|
||||
},
|
||||
[selectedLayer],
|
||||
)
|
||||
const tags = state.featureProperties.getStore(selectedElement.properties.id)
|
||||
return new SvelteUIElement(SelectedElementView, { state, layer, selectedElement, tags })
|
||||
},
|
||||
[selectedLayer]
|
||||
)
|
||||
|
||||
const selectedElementTitle = selectedElement.map(
|
||||
(selectedElement) => {
|
||||
// Svelte doesn't properly reload some of the legacy UI-elements
|
||||
// As such, we _reconstruct_ the selectedElementView every time a new feature is selected
|
||||
// This is a bit wasteful, but until everything is a svelte-component, this should do the trick
|
||||
const layer = selectedLayer.data
|
||||
if (selectedElement === undefined || layer === undefined) {
|
||||
return undefined
|
||||
}
|
||||
const selectedElementTitle = selectedElement.map(
|
||||
(selectedElement) => {
|
||||
// Svelte doesn't properly reload some of the legacy UI-elements
|
||||
// As such, we _reconstruct_ the selectedElementView every time a new feature is selected
|
||||
// This is a bit wasteful, but until everything is a svelte-component, this should do the trick
|
||||
const layer = selectedLayer.data
|
||||
if (selectedElement === undefined || layer === undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const tags = state.featureProperties.getStore(selectedElement.properties.id)
|
||||
return new SvelteUIElement(SelectedElementTitle, { state, layer, selectedElement, tags })
|
||||
},
|
||||
[selectedLayer],
|
||||
)
|
||||
const tags = state.featureProperties.getStore(selectedElement.properties.id)
|
||||
return new SvelteUIElement(SelectedElementTitle, { state, layer, selectedElement, tags })
|
||||
},
|
||||
[selectedLayer]
|
||||
)
|
||||
|
||||
let mapproperties: MapProperties = state.mapProperties
|
||||
let featureSwitches: FeatureSwitchState = state.featureSwitches
|
||||
let availableLayers = state.availableLayers
|
||||
let userdetails = state.osmConnection.userDetails
|
||||
let currentViewLayer = layout.layers.find((l) => l.id === "current_view")
|
||||
let rasterLayer: Store<RasterLayerPolygon> = state.mapProperties.rasterLayer
|
||||
let rasterLayerName =
|
||||
rasterLayer.data?.properties?.name ?? AvailableRasterLayers.maptilerDefaultLayer.properties.name
|
||||
onDestroy(
|
||||
rasterLayer.addCallbackAndRunD((l) => {
|
||||
rasterLayerName = l.properties.name
|
||||
}),
|
||||
)
|
||||
let mapproperties: MapProperties = state.mapProperties
|
||||
let featureSwitches: FeatureSwitchState = state.featureSwitches
|
||||
let availableLayers = state.availableLayers
|
||||
let userdetails = state.osmConnection.userDetails
|
||||
let currentViewLayer = layout.layers.find((l) => l.id === "current_view")
|
||||
let rasterLayer: Store<RasterLayerPolygon> = state.mapProperties.rasterLayer
|
||||
let rasterLayerName =
|
||||
rasterLayer.data?.properties?.name ?? AvailableRasterLayers.maptilerDefaultLayer.properties.name
|
||||
onDestroy(
|
||||
rasterLayer.addCallbackAndRunD((l) => {
|
||||
rasterLayerName = l.properties.name
|
||||
})
|
||||
)
|
||||
</script>
|
||||
|
||||
<div class="absolute top-0 left-0 h-screen w-screen overflow-hidden">
|
||||
|
@ -241,17 +241,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<LoginToggle ignoreLoading={true} {state }>
|
||||
<If condition={state.userRelatedState.showCrosshair.map(s => s === "yes")}>
|
||||
<If condition={state.mapProperties.zoom.map(z => z >= 17)}>
|
||||
<div class="absolute top-0 left-0 flex items-center justify-center pointer-events-none w-full h-full">
|
||||
<LoginToggle ignoreLoading={true} {state}>
|
||||
<If condition={state.userRelatedState.showCrosshair.map((s) => s === "yes")}>
|
||||
<If condition={state.mapProperties.zoom.map((z) => z >= 17)}>
|
||||
<div
|
||||
class="pointer-events-none absolute top-0 left-0 flex h-full w-full items-center justify-center"
|
||||
>
|
||||
<ToSvelte construct={Svg.cross_svg()} />
|
||||
</div>
|
||||
</If>
|
||||
</If>
|
||||
</LoginToggle>
|
||||
|
||||
|
||||
<If
|
||||
condition={selectedElementView.map(
|
||||
(v) =>
|
||||
|
@ -276,7 +277,6 @@
|
|||
</ModalRight>
|
||||
</If>
|
||||
|
||||
|
||||
<If
|
||||
condition={selectedElementView.map(
|
||||
(v) =>
|
||||
|
@ -494,5 +494,3 @@
|
|||
</TabbedGroup>
|
||||
</FloatOver>
|
||||
</If>
|
||||
|
||||
|
||||
|
|
|
@ -673,20 +673,14 @@ class SvgToPdfPage {
|
|||
|
||||
public async PrepareLanguage(language: string) {
|
||||
let host = window.location.host
|
||||
if(host.startsWith("127.0.0.1")){
|
||||
if (host.startsWith("127.0.0.1")) {
|
||||
host = "mapcomplete.org"
|
||||
}
|
||||
// Always fetch the remote data - it's cached anyway
|
||||
this.layerTranslations[language] = await Utils.downloadJsonCached(
|
||||
window.location.protocol +
|
||||
"//" +
|
||||
host +
|
||||
"/assets/langs/layers/" +
|
||||
language +
|
||||
".json",
|
||||
window.location.protocol + "//" + host + "/assets/langs/layers/" + language + ".json",
|
||||
24 * 60 * 60 * 1000
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
public async Prepare() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"contributors": [
|
||||
{
|
||||
"commits": 6139,
|
||||
"commits": 6178,
|
||||
"contributor": "Pieter Vander Vennet"
|
||||
},
|
||||
{
|
||||
|
@ -53,7 +53,7 @@
|
|||
"contributor": "Ward"
|
||||
},
|
||||
{
|
||||
"commits": 22,
|
||||
"commits": 23,
|
||||
"contributor": "dependabot[bot]"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"contributor": "kjon"
|
||||
},
|
||||
{
|
||||
"commits": 292,
|
||||
"commits": 293,
|
||||
"contributor": "Pieter Vander Vennet"
|
||||
},
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
|||
"contributor": "Allan Nordhøy"
|
||||
},
|
||||
{
|
||||
"commits": 70,
|
||||
"commits": 72,
|
||||
"contributor": "Robin van der Linde"
|
||||
},
|
||||
{
|
||||
|
@ -33,7 +33,7 @@
|
|||
"contributor": "Iago"
|
||||
},
|
||||
{
|
||||
"commits": 32,
|
||||
"commits": 33,
|
||||
"contributor": "Jiří Podhorecký"
|
||||
},
|
||||
{
|
||||
|
@ -60,6 +60,10 @@
|
|||
"commits": 22,
|
||||
"contributor": "Marco"
|
||||
},
|
||||
{
|
||||
"commits": 21,
|
||||
"contributor": "mcliquid"
|
||||
},
|
||||
{
|
||||
"commits": 21,
|
||||
"contributor": "SC"
|
||||
|
@ -68,14 +72,14 @@
|
|||
"commits": 18,
|
||||
"contributor": "el_libre como el chaval"
|
||||
},
|
||||
{
|
||||
"commits": 16,
|
||||
"contributor": "mcliquid"
|
||||
},
|
||||
{
|
||||
"commits": 15,
|
||||
"contributor": "WaldiS"
|
||||
},
|
||||
{
|
||||
"commits": 14,
|
||||
"contributor": "macpac"
|
||||
},
|
||||
{
|
||||
"commits": 14,
|
||||
"contributor": "LeJun"
|
||||
|
@ -96,6 +100,10 @@
|
|||
"commits": 13,
|
||||
"contributor": "Joost"
|
||||
},
|
||||
{
|
||||
"commits": 12,
|
||||
"contributor": "Piotr Strebski"
|
||||
},
|
||||
{
|
||||
"commits": 11,
|
||||
"contributor": "Jaime Marquínez Ferrándiz"
|
||||
|
@ -128,10 +136,6 @@
|
|||
"commits": 10,
|
||||
"contributor": "Irina"
|
||||
},
|
||||
{
|
||||
"commits": 9,
|
||||
"contributor": "Piotr Strebski"
|
||||
},
|
||||
{
|
||||
"commits": 9,
|
||||
"contributor": "Ettore Atalan"
|
||||
|
@ -154,11 +158,11 @@
|
|||
},
|
||||
{
|
||||
"commits": 8,
|
||||
"contributor": "Vinicius"
|
||||
"contributor": "gallegonovato"
|
||||
},
|
||||
{
|
||||
"commits": 7,
|
||||
"contributor": "gallegonovato"
|
||||
"commits": 8,
|
||||
"contributor": "Vinicius"
|
||||
},
|
||||
{
|
||||
"commits": 7,
|
||||
|
@ -180,10 +184,6 @@
|
|||
"commits": 7,
|
||||
"contributor": "Niels Elgaard Larsen"
|
||||
},
|
||||
{
|
||||
"commits": 6,
|
||||
"contributor": "macpac"
|
||||
},
|
||||
{
|
||||
"commits": 6,
|
||||
"contributor": "Juele juele"
|
||||
|
@ -352,6 +352,14 @@
|
|||
"commits": 3,
|
||||
"contributor": "SiegbjornSitumeang"
|
||||
},
|
||||
{
|
||||
"commits": 2,
|
||||
"contributor": "Michel"
|
||||
},
|
||||
{
|
||||
"commits": 2,
|
||||
"contributor": "Kelson Vibber"
|
||||
},
|
||||
{
|
||||
"commits": 2,
|
||||
"contributor": "Peter Brodersen"
|
||||
|
@ -456,10 +464,6 @@
|
|||
"commits": 1,
|
||||
"contributor": "Michal Čermák"
|
||||
},
|
||||
{
|
||||
"commits": 1,
|
||||
"contributor": "Kelson Vibber"
|
||||
},
|
||||
{
|
||||
"commits": 1,
|
||||
"contributor": "Juan"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue