Fix projection switch timing causing panning issues

This commit is contained in:
James Lyne 2020-12-21 18:38:58 +00:00
parent 842854967d
commit 8e18a7393f

View File

@ -15,7 +15,7 @@
--> -->
<script lang="ts"> <script lang="ts">
import {defineComponent, onMounted, onUnmounted, computed, watch} from "@vue/runtime-core"; import {defineComponent, onUnmounted, computed, watch} from "@vue/runtime-core";
import {DynmapWorldMap} from "@/dynmap"; import {DynmapWorldMap} from "@/dynmap";
import {Map} from 'leaflet'; import {Map} from 'leaflet';
import {useStore} from "@/store"; import {useStore} from "@/store";
@ -87,11 +87,10 @@ export default defineComponent({
watch(active, (newValue) => newValue ? enableLayer() : disableLayer()); watch(active, (newValue) => newValue ? enableLayer() : disableLayer());
onMounted(() => {
if(active.value) { if(active.value) {
enableLayer(); enableLayer();
} }
});
onUnmounted(() => { onUnmounted(() => {
disableLayer(); disableLayer();