mirror of
https://github.com/BlueMap-Minecraft/BlueMapVue.git
synced 2025-03-02 08:31:03 +01:00
Update to new marker interface/format
This commit is contained in:
parent
f68547b7ff
commit
19bab32ee0
@ -1 +1 @@
|
||||
Subproject commit 25c4658de4c50d9ea83d9f324b2e7cbab36176fe
|
||||
Subproject commit d703a3cf39c2b99f26cea94cf5a0eb89ac76a667
|
@ -18,7 +18,7 @@
|
||||
<path d="M22.371,4.158c1.65,0,3,1.35,3,3v15.684c0,1.65-1.35,3-3,3H7.629c-1.65,0-3-1.35-3-3V7.158c0-1.65,1.35-3,3-3H22.371z"/>
|
||||
</svg>
|
||||
</SvgButton>
|
||||
<SvgButton v-if="controls.freeFlightEnabled" :active="isFreeFlight" @action="setFreeFlight" :title="$t('controls.freeFlight.tooltip')">
|
||||
<SvgButton v-if="controls.enableFreeFlight" :active="isFreeFlight" @action="setFreeFlight" :title="$t('controls.freeFlight.tooltip')">
|
||||
<svg viewBox="0 0 30 30">
|
||||
<path d="M21.927,11.253c-0.256-0.487-0.915-0.885-1.465-0.885h-2.004c-0.55,0-0.726-0.356-0.39-0.792c0,0,0.698-0.905,0.698-2.041
|
||||
c0-2.08-1.687-3.767-3.767-3.767s-3.767,1.687-3.767,3.767c0,1.136,0.698,2.041,0.698,2.041c0.336,0.436,0.161,0.794-0.389,0.797
|
||||
|
@ -29,13 +29,12 @@ import {FreeFlightControls} from "bluemap/src/controls/freeflight/FreeFlightCont
|
||||
import {FileLoader, MathUtils, Vector3} from "three";
|
||||
import {Map as BlueMapMap} from "bluemap/src/map/Map";
|
||||
import {alert, animate, EasingFunctions, generateCacheHash} from "bluemap/src/util/Utils";
|
||||
import {PlayerMarkerManager} from "bluemap/src/markers/PlayerMarkerManager";
|
||||
import {MarkerFileManager} from "bluemap/src/markers/MarkerFileManager";
|
||||
import {MainMenu} from "@/js/MainMenu";
|
||||
import {PopupMarker} from "@/js/PopupMarker";
|
||||
import {MarkerSet} from "bluemap/src/markers/MarkerSet";
|
||||
import {getLocalStorage, round, setLocalStorage} from "@/js/Utils";
|
||||
import i18n from "../i18n";
|
||||
import {MarkerManager, MarkerFileType} from "bluemap/src/markers/MarkerManager";
|
||||
|
||||
export class BlueMapApp {
|
||||
|
||||
@ -50,14 +49,14 @@ export class BlueMapApp {
|
||||
this.mapControls = new MapControls(this.mapViewer.renderer.domElement);
|
||||
this.freeFlightControls = new FreeFlightControls(this.mapViewer.renderer.domElement);
|
||||
|
||||
/** @type {PlayerMarkerManager} */
|
||||
/** @type {MarkerManager} */
|
||||
this.playerMarkerManager = null;
|
||||
/** @type {MarkerFileManager} */
|
||||
/** @type {MarkerManager} */
|
||||
this.markerFileManager = null;
|
||||
|
||||
/** @type {{
|
||||
* useCookies: boolean,
|
||||
* freeFlightEnabled: boolean,
|
||||
* enableFreeFlight: boolean,
|
||||
* resolutionDefault: number,
|
||||
* hiresSliderMax: number,
|
||||
* hiresSliderDefault: number,
|
||||
@ -86,7 +85,7 @@ export class BlueMapApp {
|
||||
state: "perspective",
|
||||
mouseSensitivity: 1,
|
||||
invertMouse: false,
|
||||
freeFlightEnabled: false,
|
||||
enableFreeFlight: false,
|
||||
},
|
||||
menu: this.mainMenu,
|
||||
maps: [],
|
||||
@ -122,7 +121,7 @@ export class BlueMapApp {
|
||||
|
||||
// load settings
|
||||
await this.getSettings();
|
||||
this.appState.controls.freeFlightEnabled = this.settings.freeFlightEnabled;
|
||||
this.appState.controls.enableFreeFlight = this.settings.enableFreeFlight;
|
||||
|
||||
// unload loaded maps
|
||||
await this.mapViewer.switchMap(null);
|
||||
@ -326,7 +325,7 @@ export class BlueMapApp {
|
||||
const map = this.mapViewer.map;
|
||||
if (!map) return;
|
||||
|
||||
this.playerMarkerManager = new PlayerMarkerManager(this.mapViewer.markers, map.data.dataUrl + "live/players", this.events);
|
||||
this.playerMarkerManager = new MarkerManager(this.mapViewer.markers, map.data.dataUrl + "live/players", MarkerFileType.PLAYER, this.events);
|
||||
this.playerMarkerManager.setAutoUpdateInterval(0);
|
||||
return this.playerMarkerManager.update()
|
||||
.then(() => {
|
||||
@ -348,7 +347,7 @@ export class BlueMapApp {
|
||||
const map = this.mapViewer.map;
|
||||
if (!map) return;
|
||||
|
||||
this.markerFileManager = new MarkerFileManager(this.mapViewer.markers, map.data.dataUrl + "markers.json", map.data.id, this.events);
|
||||
this.markerFileManager = new MarkerManager(this.mapViewer.markers, map.data.dataUrl + "live/markers", MarkerFileType.NORMAL, this.events);
|
||||
return this.markerFileManager.update()
|
||||
.then(() => {
|
||||
this.markerFileManager.setAutoUpdateInterval(1000 * 10);
|
||||
@ -450,7 +449,7 @@ export class BlueMapApp {
|
||||
|
||||
setFreeFlight(transition = 0, targetY = undefined) {
|
||||
if (!this.mapViewer.map) return;
|
||||
if (!this.settings.freeFlightEnabled) return this.setPerspectiveView(transition);
|
||||
if (!this.settings.enableFreeFlight) return this.setPerspectiveView(transition);
|
||||
if (this.viewAnimation) this.viewAnimation.cancel();
|
||||
|
||||
let cm = this.mapViewer.controlsManager;
|
||||
|
@ -5,12 +5,16 @@ module.exports = {
|
||||
publicPath: './',
|
||||
devServer: {
|
||||
proxy: {
|
||||
'/settings.json': {
|
||||
target: 'http://localhost:8100',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/maps': {
|
||||
target: 'https://localhost:8100',
|
||||
target: 'http://localhost:8100',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/assets/playerheads': {
|
||||
target: 'https://bluecolored.de/bluemap',
|
||||
target: 'http://localhost:8100',
|
||||
changeOrigin: true,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user