forked from MapComplete/MapComplete
Bugfixes, add A3 poster
This commit is contained in:
parent
1f87728782
commit
b912343805
14 changed files with 2933 additions and 439 deletions
|
@ -191,6 +191,9 @@ export default class OverpassFeatureSource implements FeatureSource {
|
|||
|
||||
const self = this
|
||||
const overpassUrls = self.state.overpassUrl.data
|
||||
if(overpassUrls === undefined || overpassUrls.length === 0){
|
||||
throw "Panic: overpassFeatureSource didn't receive any overpassUrls"
|
||||
}
|
||||
let bounds: BBox
|
||||
do {
|
||||
try {
|
||||
|
|
|
@ -14,7 +14,7 @@ export class Overpass {
|
|||
private readonly _interpreterUrl: string
|
||||
private readonly _timeout: Store<number>
|
||||
private readonly _extraScripts: string[]
|
||||
private _includeMeta: boolean
|
||||
private readonly _includeMeta: boolean
|
||||
private _relationTracker: RelationsTracker
|
||||
|
||||
constructor(
|
||||
|
|
|
@ -166,9 +166,9 @@ export default class FeatureSwitchState {
|
|||
(layoutToUse?.overpassUrl ?? Constants.defaultOverpassUrls).join(","),
|
||||
"Point mapcomplete to a different overpass-instance. Example: https://overpass-api.de/api/interpreter"
|
||||
).sync(
|
||||
(param) => param.split(","),
|
||||
(param) => param?.split(","),
|
||||
[],
|
||||
(urls) => urls.join(",")
|
||||
(urls) => urls?.join(",")
|
||||
)
|
||||
|
||||
this.overpassTimeout = UIEventSource.asFloat(
|
||||
|
|
|
@ -6,11 +6,11 @@ import Hash from "./Hash"
|
|||
import { Utils } from "../../Utils"
|
||||
|
||||
export class QueryParameters {
|
||||
static defaults = {}
|
||||
static defaults : Record<string, string> = {}
|
||||
static documentation: Map<string, string> = new Map<string, string>()
|
||||
private static order: string[] = ["layout", "test", "z", "lat", "lon"]
|
||||
private static _wasInitialized: Set<string> = new Set()
|
||||
private static knownSources = {}
|
||||
protected static readonly _wasInitialized: Set<string> = new Set()
|
||||
protected static readonly knownSources: Record<string, UIEventSource<string>> = {}
|
||||
private static initialized = false
|
||||
|
||||
public static GetQueryParameter(
|
||||
|
@ -105,14 +105,19 @@ export class QueryParameters {
|
|||
}
|
||||
if (!Utils.runningFromConsole) {
|
||||
// Don't pollute the history every time a parameter changes
|
||||
history.replaceState(null, "", "?" + parts.join("&") + Hash.Current())
|
||||
try{
|
||||
history.replaceState(null, "", "?" + parts.join("&") + Hash.Current())
|
||||
}catch(e){
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static ClearAll() {
|
||||
for (const name in QueryParameters.knownSources) {
|
||||
QueryParameters.knownSources[name].setData("")
|
||||
QueryParameters.knownSources[name].setData(undefined)
|
||||
}
|
||||
QueryParameters._wasInitialized.clear()
|
||||
QueryParameters.order = []
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue