Themes: add possibility to enable terrain, some fixes to overlaymap and pitch control

This commit is contained in:
Pieter Vander Vennet 2024-02-03 14:33:10 +01:00
parent eede2d17dd
commit e3dec8aafa
10 changed files with 70 additions and 7 deletions

View file

@ -156,6 +156,7 @@ export default class Constants {
"addSmall",
] as const
public static readonly defaultPinIcons: string[] = <any>Constants._defaultPinIcons
public static readonly maptilerApiKey = "GvoVAJgu46I5rZapJuAy"
private static isRetina(): boolean {
if (Utils.runningFromConsole) {

View file

@ -18,8 +18,10 @@ export interface MapProperties {
readonly allowMoving: UIEventSource<true | boolean>
readonly allowRotating: UIEventSource<true | boolean>
readonly rotation: UIEventSource<number>
readonly pitch: UIEventSource<number>
readonly lastClickLocation: Store<{ lon: number; lat: number }>
readonly allowZooming: UIEventSource<true | boolean>
readonly useTerrain: Store<boolean>
/**
* Triggered when the user navigated by using the keyboard.

View file

@ -5,6 +5,7 @@ import { BBox } from "../Logic/BBox"
import { Store, Stores } from "../Logic/UIEventSource"
import { GeoOperations } from "../Logic/GeoOperations"
import { RasterLayerProperties } from "./RasterLayerProperties"
import Constants from "./Constants"
export class AvailableRasterLayers {
public static EditorLayerIndex: (Feature<Polygon, EditorLayerIndexProperties> &
@ -51,7 +52,7 @@ export class AvailableRasterLayers {
type: "Feature",
properties: {
name: "MapTiler",
url: "https://api.maptiler.com/maps/15cc8f61-0353-4be6-b8da-13daea5f7432/style.json?key=GvoVAJgu46I5rZapJuAy",
url: "https://api.maptiler.com/maps/15cc8f61-0353-4be6-b8da-13daea5f7432/style.json?key="+Constants.maptilerApiKey,
category: "osmbasedmap",
id: "maptiler",
type: "vector",

View file

@ -388,6 +388,18 @@ export interface LayoutConfigJson {
*/
enableNoteImports?: true | boolean
/**
* question: Should the map use elevation data to give a 3D-feel?
*
* This is especially useful for hiking maps, skiing maps etc...
*
* funset: MapComplete default: don't use terrain
* iftrue: Use elevation and render 3D
* iffalse: Do not use terrain
* group: advanced
*/
enableTerrain?: false | boolean
/**
* question: What overpass-api instance should be used for this layout?
*

View file

@ -61,6 +61,7 @@ export default class LayoutConfig implements LayoutInformation {
public readonly enableShowAllQuestions: boolean
public readonly enableExportButton: boolean
public readonly enablePdfDownload: boolean
public readonly enableTerrain: boolean
public readonly customCss?: string
@ -208,6 +209,7 @@ export default class LayoutConfig implements LayoutInformation {
this.enableShowAllQuestions = json.enableShowAllQuestions ?? false
this.enableExportButton = json.enableDownload ?? true
this.enablePdfDownload = json.enablePdfDownload ?? true
this.enableTerrain = json.enableTerrain ?? false
this.customCss = json.customCss
this.overpassUrl = json.overpassUrl ?? Constants.defaultOverpassUrls
this.overpassTimeout = json.overpassTimeout ?? 30