mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-07 16:58:16 +01:00
Add webapp option to default to flat-view
This commit is contained in:
parent
16c4b281ef
commit
1f7f51c1e1
@ -143,7 +143,7 @@ public void updateFiles() throws IOException {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal", "unused", "MismatchedQueryAndUpdateOfCollection"})
|
||||
private static class Settings {
|
||||
|
||||
private String version = BlueMap.VERSION;
|
||||
@ -151,6 +151,7 @@ private static class Settings {
|
||||
private boolean useCookies = true;
|
||||
|
||||
private boolean enableFreeFlight = true;
|
||||
private boolean defaultToFlatView = false;
|
||||
|
||||
private String startLocation = null;
|
||||
|
||||
@ -174,6 +175,7 @@ private static class Settings {
|
||||
public void setFrom(WebappConfig config) {
|
||||
this.useCookies = config.isUseCookies();
|
||||
this.enableFreeFlight = config.isEnableFreeFlight();
|
||||
this.defaultToFlatView = config.isDefaultToFlatView();
|
||||
this.startLocation = config.getStartLocation().orElse(null);
|
||||
this.resolutionDefault = config.getResolutionDefault();
|
||||
|
||||
|
@ -45,6 +45,7 @@ public class WebappConfig {
|
||||
private boolean useCookies = true;
|
||||
|
||||
private boolean enableFreeFlight = true;
|
||||
private boolean defaultToFlatView = false;
|
||||
|
||||
private String startLocation = null;
|
||||
|
||||
@ -83,6 +84,10 @@ public boolean isEnableFreeFlight() {
|
||||
return enableFreeFlight;
|
||||
}
|
||||
|
||||
public boolean isDefaultToFlatView() {
|
||||
return defaultToFlatView;
|
||||
}
|
||||
|
||||
public Optional<String> getStartLocation() {
|
||||
return Optional.ofNullable(startLocation);
|
||||
}
|
||||
|
@ -26,6 +26,10 @@ use-cookies: true
|
||||
# Default is true
|
||||
enable-free-flight: true
|
||||
|
||||
# If the webapp will default to flat-view instead of perspective-view.
|
||||
# Default is false
|
||||
default-to-flat-view: false
|
||||
|
||||
# The default map and camera-location where a user will start after opening the webapp.
|
||||
# This is in form of the url-anchor: Open your map in a browser and look at the url, everything after the '#' is the value for this setting.
|
||||
# Default is "no anchor" -> The camera will start with the topmost map and at that map's starting point.
|
||||
|
@ -60,6 +60,7 @@ export class BlueMapApp {
|
||||
* version: string,
|
||||
* useCookies: boolean,
|
||||
* enableFreeFlight: boolean,
|
||||
* defaultToFlatView: boolean,
|
||||
* resolutionDefault: number,
|
||||
* minZoomDistance: number,
|
||||
* maxZoomDistance: number,
|
||||
@ -280,6 +281,10 @@ export class BlueMapApp {
|
||||
|
||||
controls.controls = this.mapControls;
|
||||
this.appState.controls.state = "perspective";
|
||||
if (this.settings.defaultToFlatView) {
|
||||
this.setFlatView();
|
||||
}
|
||||
|
||||
this.updatePageAddress();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user