UX+Docs: improve documentation of background layer switch, export ELI-docs, load background layer based on category

This commit is contained in:
Pieter Vander Vennet 2024-08-25 01:43:08 +02:00
parent 33e9a94199
commit 0c4d81916f
7 changed files with 1034 additions and 69 deletions

View file

@ -5,7 +5,7 @@ import * as bingJson from "../assets/bing.json"
import { BBox } from "../Logic/BBox"
import { Store, Stores, UIEventSource } from "../Logic/UIEventSource"
import { GeoOperations } from "../Logic/GeoOperations"
import { RasterLayerProperties } from "./RasterLayerProperties"
import { EliCategory, RasterLayerProperties } from "./RasterLayerProperties"
import { Utils } from "../Utils"
export type EditorLayerIndex = (Feature<Polygon, EditorLayerIndexProperties> & RasterLayerPolygon)[]
@ -38,7 +38,7 @@ export class AvailableRasterLayers {
<RasterLayerPolygon>{
type: "Feature",
properties,
geometry: BBox.global.asGeometry(),
geometry: BBox.global.asGeometry()
}
)
public static bing = <RasterLayerPolygon>bingJson
@ -48,18 +48,18 @@ 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()
}
/**
@ -192,19 +192,12 @@ export interface EditorLayerIndexProperties extends RasterLayerProperties {
/**
* A rough categorisation of different types of layers. See https://github.com/osmlab/editor-layer-index/blob/gh-pages/CONTRIBUTING.md#categories for a description of the individual categories.
*/
readonly category?:
| "photo"
| "map"
| "historicmap"
| "osmbasedmap"
| "historicphoto"
| "qa"
| "elevation"
| "other"
readonly category?: EliCategory
/**
* A URL template for imagery tiles
*/
readonly url: string
readonly url: string
readonly min_zoom?: number
readonly max_zoom?: number
/**