chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2025-04-15 18:18:44 +02:00
parent 79b6927b56
commit 42ded4c1b1
328 changed files with 4062 additions and 1284 deletions

View file

@ -39,20 +39,24 @@ export class AvailableRasterLayers {
url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
attribution: {
text: "OpenStreetMap",
url: "https://openStreetMap.org/copyright"
url: "https://openStreetMap.org/copyright",
},
best: true,
max_zoom: 19,
min_zoom: 0,
category: "osmbasedmap"
category: "osmbasedmap",
}
public static readonly osmCarto: RasterLayerPolygon = {
type: "Feature",
properties: AvailableRasterLayers.osmCartoProperties,
geometry: BBox.global.asGeometry()
geometry: BBox.global.asGeometry(),
}
public static allAvailableGlobalLayers = new Set([...AvailableRasterLayers.globalLayers, AvailableRasterLayers.osmCarto, AvailableRasterLayers.bing])
public static allAvailableGlobalLayers = new Set([
...AvailableRasterLayers.globalLayers,
AvailableRasterLayers.osmCarto,
AvailableRasterLayers.bing,
])
private static initGlobalLayers(): RasterLayerPolygon[] {
const gl: RasterLayerProperties[] = (globallayers["default"] ?? globallayers).layers.filter(
@ -75,8 +79,6 @@ export class AvailableRasterLayers {
)
}
/**
* The default background layer that any theme uses which does not explicitly define a background
*/

View file

@ -1,7 +1,10 @@
import { DesugaringStep } from "./Conversion"
import { TagRenderingConfigJson } from "../Json/TagRenderingConfigJson"
import { LayerConfigJson } from "../Json/LayerConfigJson"
import { MappingConfigJson, QuestionableTagRenderingConfigJson } from "../Json/QuestionableTagRenderingConfigJson"
import {
MappingConfigJson,
QuestionableTagRenderingConfigJson,
} from "../Json/QuestionableTagRenderingConfigJson"
import { ConversionContext } from "./ConversionContext"
import { Translation } from "../../../UI/i18n/Translation"
import { TagUtils } from "../../../Logic/Tags/TagUtils"

View file

@ -1,6 +1,18 @@
import { Concat, DesugaringContext, DesugaringStep, Each, FirstOf, Fuse, On, SetDefault } from "./Conversion"
import {
Concat,
DesugaringContext,
DesugaringStep,
Each,
FirstOf,
Fuse,
On,
SetDefault,
} from "./Conversion"
import { LayerConfigJson } from "../Json/LayerConfigJson"
import { MinimalTagRenderingConfigJson, TagRenderingConfigJson } from "../Json/TagRenderingConfigJson"
import {
MinimalTagRenderingConfigJson,
TagRenderingConfigJson,
} from "../Json/TagRenderingConfigJson"
import { Utils } from "../../../Utils"
import RewritableConfigJson from "../Json/RewritableConfigJson"
import SpecialVisualizations from "../../../UI/SpecialVisualizations"

View file

@ -271,7 +271,6 @@ export interface QuestionableTagRenderingConfigJson extends TagRenderingConfigJs
*/
default?: string
/**
* question: If this key shared and distinguished by a postfix, what is the postfix?
* This option is used specifically for `charge`, where the cost is indicated with `/item`.

View file

@ -381,14 +381,11 @@ export default class LayerConfig extends WithContextLoader {
* @private
*/
private generateDocumentationQuickTable(): string {
return MarkdownUtils.table(
["id", "question", "labels", "freeform key"],
this.tagRenderings
.filter(tr => tr.labels.indexOf("ignore_docs") < 0)
.map(tr => {
.filter((tr) => tr.labels.indexOf("ignore_docs") < 0)
.map((tr) => {
let key = "_Multiple choice only_"
if (tr.freeform) {
const type = `[${tr.freeform.type}](../SpecialInputElements.md#${tr.freeform.type})`
@ -419,14 +416,10 @@ export default class LayerConfig extends WithContextLoader {
`[${tr.id}](#${tr.id}) ${origDef}`,
Utils.NoNull([q, r, options]).join("<br/>"),
tr.labels.join(", "),
key
key,
]
})
)
}
public generateDocumentation(

View file

@ -5,7 +5,10 @@ import { TagUtils } from "../../Logic/Tags/TagUtils"
import { And } from "../../Logic/Tags/And"
import { Utils } from "../../Utils"
import { Tag } from "../../Logic/Tags/Tag"
import { MappingConfigJson, QuestionableTagRenderingConfigJson } from "./Json/QuestionableTagRenderingConfigJson"
import {
MappingConfigJson,
QuestionableTagRenderingConfigJson,
} from "./Json/QuestionableTagRenderingConfigJson"
import Validators, { ValidatorType } from "../../UI/InputElement/Validators"
import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson"
import { RegexTag } from "../../Logic/Tags/RegexTag"
@ -697,7 +700,10 @@ export default class TagRenderingConfig {
* TagRenderingConfig.splitPostfixDistinguished(" €10 / day ") // => {value: "€10", denomination: "day"}
*
*/
private static splitPostfixDistinguished(part: string): { value: string, denomination: string } {
private static splitPostfixDistinguished(part: string): {
value: string
denomination: string
} {
const i = part.indexOf("/")
if (i < 0) {
return { value: part, denomination: "" }

View file

@ -43,7 +43,9 @@ export class UserMapFeatureswitchState extends WithUserRelatedState {
readonly geolocationState: GeoLocationState
readonly geolocation: GeoLocationHandler
readonly geolocationControl: GeolocationControlState
readonly historicalUserLocations: WritableFeatureSource<Feature<Point, GeoLocationPointProperties>>
readonly historicalUserLocations: WritableFeatureSource<
Feature<Point, GeoLocationPointProperties>
>
readonly availableLayers: { store: Store<RasterLayerPolygon[]> }
readonly currentView: FeatureSource<Feature<Polygon>>

View file

@ -55,7 +55,7 @@ export class WithImageState extends WithGuiState implements SpecialVisualization
featureSwitches: this.featureSwitches,
selectedElement: this.selectedElement,
indexedFeatures: this.indexedFeatures,
guistate: this.guistate
guistate: this.guistate,
})
new PendingChangesUploader(this.changes, this.selectedElement, this.imageUploadManager)
}

View file

@ -86,7 +86,7 @@ export class Tiles {
static asGeojson(zIndex: number, x?: number, y?: number): Feature<Polygon> {
let z = zIndex
if (x === undefined) {
[z, x, y] = Tiles.tile_from_index(zIndex)
;[z, x, y] = Tiles.tile_from_index(zIndex)
}
const bounds = Tiles.tile_bounds_lon_lat(z, x, y)
return new BBox(bounds).asGeoJson()
@ -161,10 +161,10 @@ export class Tiles {
private static lat2tile(lat: number, zoom: number): number {
return Math.floor(
((1 -
Math.log(Math.tan((lat * Math.PI) / 180) + 1 / Math.cos((lat * Math.PI) / 180)) /
Math.log(Math.tan((lat * Math.PI) / 180) + 1 / Math.cos((lat * Math.PI) / 180)) /
Math.PI) /
2) *
Math.pow(2, zoom)
Math.pow(2, zoom)
)
}
}