From 971cd72af5fad9b7e6ad0be646428409c5951c90 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Sun, 6 Feb 2022 20:03:50 +0000 Subject: [PATCH] Update leaflet --- package-lock.json | 8 ++++---- package.json | 2 +- src/leaflet/icon/GenericIcon.ts | 7 ++----- src/leaflet/icon/PlayerIcon.ts | 6 +----- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index d5d8c49..5647d60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@kyvg/vue3-notification": "2.3.0", "@soerenmartius/vue3-clipboard": "^0.1", - "leaflet": "git+https://github.com/JLyne/Leaflet.git#2805e6e6c2a7a2ca66a6dc642b1a199ee6669004", + "leaflet": "git+https://github.com/JLyne/Leaflet.git#f056e232a9f35ea3f15c054043a12c318fcb88b5", "lodash.debounce": "^4.0.8", "modern-normalize": "^1.1.0", "vue": "^3.2.29", @@ -8290,7 +8290,7 @@ }, "node_modules/leaflet": { "version": "1.7.1-LiveAtlas", - "resolved": "git+ssh://git@github.com/JLyne/Leaflet.git#2805e6e6c2a7a2ca66a6dc642b1a199ee6669004", + "resolved": "git+ssh://git@github.com/JLyne/Leaflet.git#f056e232a9f35ea3f15c054043a12c318fcb88b5", "license": "BSD-2-Clause" }, "node_modules/leven": { @@ -18447,8 +18447,8 @@ "dev": true }, "leaflet": { - "version": "git+ssh://git@github.com/JLyne/Leaflet.git#2805e6e6c2a7a2ca66a6dc642b1a199ee6669004", - "from": "leaflet@git+https://github.com/JLyne/Leaflet.git#2805e6e6c2a7a2ca66a6dc642b1a199ee6669004" + "version": "git+ssh://git@github.com/JLyne/Leaflet.git#f056e232a9f35ea3f15c054043a12c318fcb88b5", + "from": "leaflet@git+https://github.com/JLyne/Leaflet.git#f056e232a9f35ea3f15c054043a12c318fcb88b5" }, "leven": { "version": "3.1.0", diff --git a/package.json b/package.json index 54f3be3..b0185fc 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@kyvg/vue3-notification": "2.3.0", "@soerenmartius/vue3-clipboard": "^0.1", - "leaflet": "git+https://github.com/JLyne/Leaflet.git#2805e6e6c2a7a2ca66a6dc642b1a199ee6669004", + "leaflet": "git+https://github.com/JLyne/Leaflet.git#f056e232a9f35ea3f15c054043a12c318fcb88b5", "lodash.debounce": "^4.0.8", "modern-normalize": "^1.1.0", "vue": "^3.2.29", diff --git a/src/leaflet/icon/GenericIcon.ts b/src/leaflet/icon/GenericIcon.ts index e6a1a5c..6ccfa05 100644 --- a/src/leaflet/icon/GenericIcon.ts +++ b/src/leaflet/icon/GenericIcon.ts @@ -51,6 +51,8 @@ const defaultOptions: GenericIconOptions = { export class GenericIcon extends Layer implements Icon { declare options: GenericIconOptions; + declare createShadow: (oldIcon?: HTMLElement) => HTMLElement; + private _image?: HTMLImageElement; private _label?: HTMLSpanElement; private _container?: HTMLDivElement; @@ -97,11 +99,6 @@ export class GenericIcon extends Layer implements Icon { return div; } - createShadow(oldIcon?: HTMLElement): HTMLElement { - // @ts-ignore - Typings are wrong here, can return null - return null; - } - createLabel() { if(!this._container || this._labelCreated) { return; diff --git a/src/leaflet/icon/PlayerIcon.ts b/src/leaflet/icon/PlayerIcon.ts index 50beae9..d699e15 100644 --- a/src/leaflet/icon/PlayerIcon.ts +++ b/src/leaflet/icon/PlayerIcon.ts @@ -36,6 +36,7 @@ export interface PlayerIconOptions extends BaseIconOptions { export class PlayerIcon extends Layer implements Icon { declare options: PlayerIconOptions; + declare createShadow: (oldIcon?: HTMLElement) => HTMLElement; private readonly _player: LiveAtlasPlayer; private _container?: HTMLDivElement; @@ -120,11 +121,6 @@ export class PlayerIcon extends Layer implements Icon { return this._container; } - createShadow(oldIcon?: HTMLElement): HTMLElement { - // @ts-ignore - Typings are wrong here, can return null - return null; - } - updateImage() { getMinecraftHead(this._player, this.options.imageSize).then(head => { this._playerImage!.src = head.src;