forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
1d87151228
185 changed files with 4687 additions and 2421 deletions
|
|
@ -19,6 +19,7 @@
|
|||
export let filteredLayer: FilteredLayer
|
||||
export let highlightedLayer: Store<string | undefined> = new ImmutableStore(undefined)
|
||||
export let zoomlevel: Store<number> = new ImmutableStore(22)
|
||||
export let showLayerTitle = true
|
||||
let layer: LayerConfig = filteredLayer.layerDef
|
||||
let isDisplayed: UIEventSource<boolean> = filteredLayer.isDisplayed
|
||||
|
||||
|
|
@ -27,7 +28,7 @@
|
|||
(s) =>
|
||||
(s === "yes" &&
|
||||
state?.userRelatedState?.osmConnection?.userDetails?.data?.csCount >=
|
||||
Constants.userJourney.tagsVisibleAt) ||
|
||||
Constants.userJourney.tagsVisibleAt) ||
|
||||
s === "always" ||
|
||||
s === "full"
|
||||
)
|
||||
|
|
@ -54,19 +55,21 @@
|
|||
|
||||
{#if filteredLayer.layerDef.name}
|
||||
<div class:focus={$highlightedLayer === filteredLayer.layerDef.id} class="mb-1.5">
|
||||
<Checkbox selected={isDisplayed}>
|
||||
<div class="no-image-background block h-6 w-6" class:opacity-50={!$isDisplayed}>
|
||||
<ToSvelte construct={() => layer.defaultIcon()} />
|
||||
</div>
|
||||
{#if showLayerTitle}
|
||||
<Checkbox selected={isDisplayed}>
|
||||
<div class="no-image-background block h-6 w-6" class:opacity-50={!$isDisplayed}>
|
||||
<ToSvelte construct={() => layer.defaultIcon()} />
|
||||
</div>
|
||||
|
||||
<Tr t={filteredLayer.layerDef.name} />
|
||||
<Tr t={filteredLayer.layerDef.name} />
|
||||
|
||||
{#if $zoomlevel < layer.minzoom}
|
||||
{#if $zoomlevel < layer.minzoom}
|
||||
<span class="alert">
|
||||
<Tr t={Translations.t.general.layerSelection.zoomInToSeeThisLayer} />
|
||||
</span>
|
||||
{/if}
|
||||
</Checkbox>
|
||||
{/if}
|
||||
</Checkbox>
|
||||
{/if}
|
||||
|
||||
{#if $isDisplayed && filteredLayer.layerDef.filters?.length > 0}
|
||||
<div id="subfilters" class="ml-4 flex flex-col gap-y-1">
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@
|
|||
<EnvelopeOpen class="h-6 w-6" />
|
||||
<Tr t={Translations.t.general.attribution.emailCreators} />
|
||||
</a>
|
||||
<a class="flex" href="https://hosted.weblate.org/projects/mapcomplete/" target="_blank">
|
||||
<a class="flex" href={`${Constants.weblate}projects/mapcomplete/`} target="_blank">
|
||||
<TranslateIcon class="h-6 w-6" />
|
||||
<Tr t={Translations.t.translations.activateButton} />
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export class StackedRenderingChart extends ChartJs {
|
|||
period: "day" | "month"
|
||||
groupToOtherCutoff?: 3 | number
|
||||
// If given, take the sum of these fields to get the feature weight
|
||||
sumFields?: string[]
|
||||
sumFields?: ReadonlyArray<string>
|
||||
hideUnknown?: boolean
|
||||
hideNotApplicable?: boolean
|
||||
}
|
||||
|
|
@ -57,9 +57,9 @@ export class StackedRenderingChart extends ChartJs {
|
|||
backgroundColor: string
|
||||
}[] = []
|
||||
const allDays = StackedRenderingChart.getAllDays(features)
|
||||
let trimmedDays = allDays.map((d) => d.substr(0, 10))
|
||||
let trimmedDays = allDays.map((d) => d.substring(0, 10))
|
||||
if (options?.period === "month") {
|
||||
trimmedDays = trimmedDays.map((d) => d.substr(0, 7))
|
||||
trimmedDays = trimmedDays.map((d) => d.substring(0, 7))
|
||||
}
|
||||
trimmedDays = Utils.Dedup(trimmedDays)
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ export class StackedRenderingChart extends ChartJs {
|
|||
): string[] {
|
||||
let earliest: Date = undefined
|
||||
let latest: Date = undefined
|
||||
let allDates = new Set<string>()
|
||||
const allDates = new Set<string>()
|
||||
features.forEach((value) => {
|
||||
const d = new Date(value.properties.date)
|
||||
Utils.SetMidnight(d)
|
||||
|
|
@ -290,10 +290,10 @@ export default class TagRenderingChart extends Combine {
|
|||
const mappings = tagRendering.mappings ?? []
|
||||
|
||||
options = options ?? {}
|
||||
let unknownCount: T[] = []
|
||||
const categoryCounts: T[][] = mappings.map((_) => [])
|
||||
const unknownCount: T[] = []
|
||||
const categoryCounts: T[][] = mappings.map(() => [])
|
||||
const otherCounts: Record<string, T[]> = {}
|
||||
let notApplicable: T[] = []
|
||||
const notApplicable: T[] = []
|
||||
for (const feature of features) {
|
||||
const props = feature.properties
|
||||
if (
|
||||
|
|
@ -346,7 +346,7 @@ export default class TagRenderingChart extends Combine {
|
|||
return { labels: undefined, data: undefined }
|
||||
}
|
||||
|
||||
let otherGrouped: T[] = []
|
||||
const otherGrouped: T[] = []
|
||||
const otherLabels: string[] = []
|
||||
const otherData: T[][] = []
|
||||
const sortedOtherCounts: [string, T[]][] = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue