Chore: housekeeping

This commit is contained in:
Pieter Vander Vennet 2025-02-10 02:04:58 +01:00
parent cd9e03dd6f
commit b300fffdc5
156 changed files with 4436 additions and 1318 deletions

View file

@ -129,8 +129,8 @@ export default class TagRenderingConfig {
this.id
)
}
if(json.labels && !Array.isArray( json.labels)){
throw (`Invalid labels at ${context}: labels should be a list of strings, but got a ${typeof json.labels}`)
if (json.labels && !Array.isArray(json.labels)) {
throw `Invalid labels at ${context}: labels should be a list of strings, but got a ${typeof json.labels}`
}
this.labels = json.labels ?? []

View file

@ -18,7 +18,7 @@ import { Store, UIEventSource } from "../../Logic/UIEventSource"
import NearbyFeatureSource from "../../Logic/FeatureSource/Sources/NearbyFeatureSource"
import {
SummaryTileSource,
SummaryTileSourceRewriter
SummaryTileSourceRewriter,
} from "../../Logic/FeatureSource/TiledFeatureSource/SummaryTileSource"
import { ShowDataLayerOptions } from "../../UI/Map/ShowDataLayerOptions"
@ -94,10 +94,7 @@ export class WithSpecialLayers extends WithChangesState {
const maxzoom = Math.min(...normalLayers.map((l) => l.minzoom))
const layers = this.theme.layers.filter(
(l) =>
!Constants.isPriviliged(l) &&
l.source.geojsonSource === undefined &&
l.doCount
(l) => !Constants.isPriviliged(l) && l.source.geojsonSource === undefined && l.doCount
)
if (!Constants.SummaryServer || layers.length === 0) {
return undefined

View file

@ -81,12 +81,12 @@ export class Tiles {
return [z, x, index % factor]
}
static asGeojson(index: number): Feature<Polygon>;
static asGeojson(x: number, y: number, z: number): Feature<Polygon>;
static asGeojson(index: number): Feature<Polygon>
static asGeojson(x: number, y: number, z: number): Feature<Polygon>
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()