Skip to content

Commit

Permalink
Reload tiles when map widget is resized
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Jul 31, 2023
1 parent 0ab4307 commit b525436
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/widgets/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ import { useRefHistory } from '@vueuse/core'
import { formatDistanceToNow } from 'date-fns'
import type { Map } from 'leaflet'
import Swal from 'sweetalert2'
import { type Ref, computed, nextTick, onBeforeMount, ref, toRefs } from 'vue'
import { type Ref, computed, nextTick, onBeforeMount, ref, toRefs, watch } from 'vue'
import { degrees } from '@/libs/utils'
import { useMainVehicleStore } from '@/stores/mainVehicle'
Expand Down Expand Up @@ -237,6 +237,10 @@ const props = defineProps<{
const widget = toRefs(props).widget
watch(props.widget, () => {
leafletObject.value?.invalidateSize()
})
onBeforeMount(() => {
// Set initial widget options if they don't exist
if (Object.keys(widget.value.options).length === 0) {
Expand Down

0 comments on commit b525436

Please sign in to comment.