forked from MapComplete/MapComplete
Fix overlays in PDF, add overlay URL parameters
This commit is contained in:
parent
891c449058
commit
4e43673de5
9 changed files with 32 additions and 9 deletions
|
@ -3,12 +3,17 @@
|
|||
*/
|
||||
export default interface TilesourceConfigJson {
|
||||
|
||||
|
||||
/**
|
||||
* Id of this overlay, used in the URL-parameters to set the state
|
||||
*/
|
||||
id: string,
|
||||
/**
|
||||
* The path, where {x}, {y} and {z} will be substituted
|
||||
*/
|
||||
source: string,
|
||||
|
||||
/**
|
||||
* Wether or not this is an overlay. Default: true
|
||||
*/
|
||||
isOverlay?: boolean,
|
||||
|
||||
/**
|
||||
|
|
|
@ -254,7 +254,7 @@ export default class LayerConfig {
|
|||
)}`;
|
||||
}
|
||||
|
||||
return new TagRenderingConfig("questions", undefined);
|
||||
return new TagRenderingConfig("questions", undefined, context);
|
||||
}
|
||||
|
||||
if (renderingJson["override"] !== undefined) {
|
||||
|
|
|
@ -4,6 +4,7 @@ import {Translation} from "../../UI/i18n/Translation";
|
|||
|
||||
export default class TilesourceConfig {
|
||||
public readonly source: string
|
||||
public readonly id: string
|
||||
public readonly isOverlay: boolean
|
||||
public readonly name: Translation
|
||||
public readonly minzoom: number
|
||||
|
@ -11,13 +12,16 @@ export default class TilesourceConfig {
|
|||
public readonly defaultState: boolean;
|
||||
|
||||
constructor(config: TilesourceConfigJson, ctx: string = "") {
|
||||
|
||||
this.id = config.id
|
||||
this.source = config.source;
|
||||
this.isOverlay = config.isOverlay ?? false;
|
||||
this.name = Translations.T(config.name)
|
||||
this.minzoom = config.minZoom ?? 0
|
||||
this.maxzoom = config.maxZoom ?? 999
|
||||
this.defaultState = config.defaultState ?? true;
|
||||
if(this.id === undefined){
|
||||
throw "An id is obligated"
|
||||
}
|
||||
if (this.minzoom > this.maxzoom) {
|
||||
throw "Invalid tilesourceConfig: minzoom should be smaller then maxzoom (at " + ctx + ")"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue