Merge branch 'develop' into alpha
This commit is contained in:
commit
aa1b33f9e4
11 changed files with 103 additions and 63 deletions
|
@ -1,6 +1,5 @@
|
|||
import {TagRenderingConfigJson} from "./TagRenderingConfigJson";
|
||||
import {LayerConfigJson} from "./LayerConfigJson";
|
||||
import UnitConfigJson from "./UnitConfigJson";
|
||||
|
||||
/**
|
||||
* Defines the entire theme.
|
||||
|
@ -250,7 +249,7 @@ export interface LayoutConfigJson {
|
|||
* If set to [[lat0, lon0], [lat1, lon1]], the map will not scroll outside of those bounds.
|
||||
* Off by default, which will enable panning to the entire world
|
||||
*/
|
||||
lockLocation?: boolean | [[number, number], [number, number]];
|
||||
lockLocation?: boolean | [[number, number], [number, number]] | number[][];
|
||||
|
||||
enableUserBadge?: boolean;
|
||||
enableShareScreen?: boolean;
|
||||
|
|
|
@ -29,7 +29,7 @@ export default class LayoutConfig {
|
|||
public layers: LayerConfig[];
|
||||
public readonly clustering?: {
|
||||
maxZoom: number,
|
||||
minNeededElements: number
|
||||
minNeededElements: number,
|
||||
};
|
||||
public readonly hideFromOverview: boolean;
|
||||
public lockLocation: boolean | [[number, number], [number, number]];
|
||||
|
@ -137,12 +137,17 @@ export default class LayoutConfig {
|
|||
|
||||
this.clustering = {
|
||||
maxZoom: 16,
|
||||
minNeededElements: 25
|
||||
minNeededElements: 25,
|
||||
};
|
||||
if (json.clustering) {
|
||||
if(json.clustering === false){
|
||||
this.clustering = {
|
||||
maxZoom: 0,
|
||||
minNeededElements: 100000,
|
||||
};
|
||||
}else if (json.clustering) {
|
||||
this.clustering = {
|
||||
maxZoom: json.clustering.maxZoom ?? 18,
|
||||
minNeededElements: json.clustering.minNeededElements ?? 25
|
||||
minNeededElements: json.clustering.minNeededElements ?? 25,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,7 +156,7 @@ export default class LayoutConfig {
|
|||
if (json.hideInOverview) {
|
||||
throw "The json for " + this.id + " contains a 'hideInOverview'. Did you mean hideFromOverview instead?"
|
||||
}
|
||||
this.lockLocation = json.lockLocation ?? undefined;
|
||||
this.lockLocation = <[[number, number], [number, number]]> json.lockLocation ?? undefined;
|
||||
this.enableUserBadge = json.enableUserBadge ?? true;
|
||||
this.enableShareScreen = json.enableShareScreen ?? true;
|
||||
this.enableMoreQuests = json.enableMoreQuests ?? true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue