Skip to content

Commit

Permalink
fix: fixed PointExpression type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Biasi committed Apr 4, 2023
1 parent 2a9af77 commit a0bcc6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
3 changes: 2 additions & 1 deletion databrowser/src/components/map/MapBase.vue
Expand Up @@ -27,6 +27,7 @@

<script lang="ts" setup>
import { defineProps, defineAsyncComponent } from 'vue';
import { PointExpression } from 'leaflet';
import 'leaflet/dist/leaflet.css';
const LMap = defineAsyncComponent(() =>
Expand All @@ -52,7 +53,7 @@ interface Position {
withDefaults(
defineProps<{
center?: Array<number>;
center?: PointExpression;
markers: Array<Marker>;
zoom?: number;
height?: string;
Expand Down
15 changes: 5 additions & 10 deletions databrowser/src/components/quickview/QuickViewMapView.vue
Expand Up @@ -5,25 +5,20 @@
:sections="[]"
>
<template #content>
<MapBase
ref="mapComponent"
:key="map.center.length"
:center="map.center"
:markers="map.markers"
/>
<MapBase :center="map.center" :markers="map.markers" />
</template>
</QuickViewCardOverview>
</template>

<script setup lang="ts">
import { computed, defineProps, withDefaults, ref } from 'vue';
import { computed, defineProps, withDefaults } from 'vue';
import { PointExpression } from 'leaflet';
import { useI18n } from 'vue-i18n';
import QuickViewCardOverview from './QuickViewCardOverview.vue';
import MapBase from '../../components/map/MapBase.vue';
const { t } = useI18n();
const mapComponent = ref();
interface GpsInfo {
Latitude: number;
Expand All @@ -42,15 +37,15 @@ const props = withDefaults(
const map = computed(() => {
if (!props.gpsInfo.length) {
return {
center: [],
center: undefined,
markers: [],
};
}
const { Longitude, Latitude } = props.gpsInfo[0];
const mapObj = {
center: [Latitude, Longitude],
center: [Latitude, Longitude] as PointExpression,
markers: [
{
position: {
Expand Down

0 comments on commit a0bcc6a

Please sign in to comment.