forked from MapComplete/MapComplete
Scripts: fix overview-support for osm-community, switch server
This commit is contained in:
parent
90aa2f1fc1
commit
30604304eb
4 changed files with 23 additions and 9 deletions
|
|
@ -6,7 +6,7 @@ import { BBox } from "../../BBox"
|
|||
import LayerConfig from "../../../Models/ThemeConfig/LayerConfig"
|
||||
|
||||
export default class DynamicGeoJsonTileSource extends UpdatableDynamicTileSource {
|
||||
private static whitelistCache = new Map<string, any>()
|
||||
private static whitelistCache = new Map<string, Map<number, Set<number>>>()
|
||||
|
||||
constructor(
|
||||
layer: LayerConfig,
|
||||
|
|
@ -27,7 +27,7 @@ export default class DynamicGeoJsonTileSource extends UpdatableDynamicTileSource
|
|||
}
|
||||
console.log("Creating a dynamic geojson source for", layer.source.geojsonSource)
|
||||
|
||||
let whitelist = undefined
|
||||
let whitelist: Map<number, Set<number>> = undefined
|
||||
if (source.geojsonSource.indexOf("{x}_{y}.geojson") > 0) {
|
||||
const whitelistUrl = source.geojsonSource
|
||||
.replace("{z}", "" + source.geojsonZoomLevel)
|
||||
|
|
@ -37,8 +37,8 @@ export default class DynamicGeoJsonTileSource extends UpdatableDynamicTileSource
|
|||
if (DynamicGeoJsonTileSource.whitelistCache.has(whitelistUrl)) {
|
||||
whitelist = DynamicGeoJsonTileSource.whitelistCache.get(whitelistUrl)
|
||||
} else {
|
||||
Utils.downloadJsonCached(whitelistUrl, 1000 * 60 * 60)
|
||||
.then((json) => {
|
||||
Utils.downloadJsonCached<Record<string | number, number[]>>(whitelistUrl, 1000 * 60 * 60)
|
||||
.then(json => {
|
||||
const data = new Map<number, Set<number>>()
|
||||
for (const x in json) {
|
||||
if (x === "zoom") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue