@@ -60,7 +60,7 @@ export default defineComponent({
setup() {
const store = useStore(),
- leaflet = undefined as DynmapMap | undefined,
+ leaflet = undefined as any,
maps = computed(() => store.state.maps),
markerSets = computed(() => store.state.markerSets),
@@ -193,7 +193,7 @@ export default defineComponent({
crs: CRS.Simple,
worldCopyJump: false,
// markerZoomAnimation: false,
- }));
+ })) as DynmapMap;
this.leaflet.createPane('vectors');
diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue
index 8f9b04e..5bc13e0 100644
--- a/src/components/Sidebar.vue
+++ b/src/components/Sidebar.vue
@@ -45,6 +45,8 @@ import {useStore} from "@/store";
import SvgIcon from "@/components/SvgIcon.vue";
import {MutationTypes} from "@/store/mutation-types";
import {DynmapUIElement} from "@/dynmap";
+import "@/assets/icons/players.svg";
+import "@/assets/icons/maps.svg";
export default defineComponent({
components: {
diff --git a/src/components/SvgIcon.vue b/src/components/SvgIcon.vue
index 69b8655..4f33433 100644
--- a/src/components/SvgIcon.vue
+++ b/src/components/SvgIcon.vue
@@ -39,12 +39,7 @@ export default {
computed: {
iconPath() {
- let icon = require(`@/assets/icons/${this.name}.svg`);
- if (Object.prototype.hasOwnProperty.call(icon, 'default')) {
- icon = icon.default;
- }
-
- return icon.url;
+ return `#${this.name}`;
},
className() {
diff --git a/src/components/chat/ChatMessage.vue b/src/components/chat/ChatMessage.vue
index 80afcd8..8a7183e 100644
--- a/src/components/chat/ChatMessage.vue
+++ b/src/components/chat/ChatMessage.vue
@@ -27,8 +27,7 @@
import {DynmapChat} from "@/dynmap";
import {getMinecraftHead} from '@/util';
import {useStore} from "@/store";
-
- const defaultImage = require('@/assets/images/player_face.png');
+ import defaultImage from '@/assets/images/player_face.png';
export default defineComponent({
props: {
diff --git a/src/components/sidebar/FollowTarget.vue b/src/components/sidebar/FollowTarget.vue
index 8f9b497..3d74ca4 100644
--- a/src/components/sidebar/FollowTarget.vue
+++ b/src/components/sidebar/FollowTarget.vue
@@ -37,8 +37,7 @@ import {useStore} from "@/store";
import {MutationTypes} from "@/store/mutation-types";
import {defineComponent, onMounted, ref, watch} from "@vue/runtime-core";
import {getMinecraftHead} from '@/util';
-
-const defaultImage = require('@/assets/images/player_face.png');
+import defaultImage from '@/assets/images/player_face.png';
export default defineComponent({
name: 'FollowTarget',
diff --git a/src/components/sidebar/PlayerListItem.vue b/src/components/sidebar/PlayerListItem.vue
index 4ee2570..a16b5aa 100644
--- a/src/components/sidebar/PlayerListItem.vue
+++ b/src/components/sidebar/PlayerListItem.vue
@@ -31,8 +31,7 @@ import {DynmapPlayer} from "@/dynmap";
import {useStore} from "@/store";
import {MutationTypes} from "@/store/mutation-types";
import {getMinecraftHead} from '@/util';
-
-const defaultImage = require('@/assets/images/player_face.png');
+import defaultImage from '@/assets/images/player_face.png';
export default defineComponent({
name: 'PlayerListItem',
diff --git a/src/components/sidebar/WorldListItem.vue b/src/components/sidebar/WorldListItem.vue
index ee708b0..4a52270 100644
--- a/src/components/sidebar/WorldListItem.vue
+++ b/src/components/sidebar/WorldListItem.vue
@@ -33,6 +33,17 @@ import {DynmapWorldMap, DynmapWorld} from "@/dynmap";
import {defineComponent} from 'vue';
import {MutationTypes} from "@/store/mutation-types";
import SvgIcon from "@/components/SvgIcon.vue";
+import "@/assets/icons/block_world_surface.svg";
+import "@/assets/icons/block_world_cave.svg";
+import "@/assets/icons/block_world_biome.svg";
+import "@/assets/icons/block_world_flat.svg";
+import "@/assets/icons/block_nether_flat.svg";
+import "@/assets/icons/block_nether_surface.svg";
+import "@/assets/icons/block_the_end_flat.svg";
+import "@/assets/icons/block_the_end_surface.svg";
+import "@/assets/icons/block_other.svg";
+import "@/assets/icons/block_other_flat.svg";
+import "@/assets/icons/block_skylands.svg";
export default defineComponent({
name: 'WorldListItem',
diff --git a/src/dynmap.d.ts b/src/dynmap.d.ts
index 5f3342b..5f88284 100644
--- a/src/dynmap.d.ts
+++ b/src/dynmap.d.ts
@@ -116,7 +116,7 @@ interface DynmapWorld {
title: string;
height: number;
center: Coordinate;
- maps: Map
;
+ maps: Map;
}
interface DynmapWorldMap {
diff --git a/src/index.d.ts b/src/index.d.ts
index c2613b2..dc00241 100644
--- a/src/index.d.ts
+++ b/src/index.d.ts
@@ -1,12 +1,20 @@
-declare module '*.svg' {
- const content: any;
- export default content;
+import { ComponentCustomProperties } from 'vue'
+import {State, Store} from "@/store";
+
+declare module "*.png" {
+ const value: any;
+ export = value;
}
-interface BrowserSpriteSymbol {
- id: string;
- viewBox: string;
- content: string;
- node: SVGSymbolElement;
- url: string;
+declare module '*.vue' {
+ import type { DefineComponent } from 'vue'
+ const component: DefineComponent<{}, {}, any>
+ export default component
+}
+
+declare module '@vue/runtime-core' {
+ // provide typings for `this.$store`
+ interface ComponentCustomProperties {
+ $store: Store
+ }
}
\ No newline at end of file
diff --git a/src/leaflet/control/ChatControl.ts b/src/leaflet/control/ChatControl.ts
index 32180c3..9b5a0f2 100644
--- a/src/leaflet/control/ChatControl.ts
+++ b/src/leaflet/control/ChatControl.ts
@@ -15,11 +15,12 @@
*/
import {Control, ControlOptions, DomUtil, Map} from 'leaflet';
-import chat from '@/assets/icons/chat.svg';
import {useStore} from "@/store";
import {MutationTypes} from "@/store/mutation-types";
import {watch} from "@vue/runtime-core";
+import "@/assets/icons/chat.svg";
+
export class ChatControl extends Control {
// @ts-ignore
options: ControlOptions
@@ -34,8 +35,8 @@ export class ChatControl extends Control {
chatButton.type = 'button';
chatButton.title = 'Chat';
chatButton.innerHTML = `
-