From 9499b4694dec11fc72af34bab3cfbfeb867835c8 Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> Date: Tue, 14 Mar 2023 03:21:35 +0530 Subject: [PATCH] =?UTF-8?q?feat:=20typings=20&=20add=20IndexDb=20instead?= =?UTF-8?q?=20of=20ls=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> --- components/map/layers/Cluster.vue | 11 +- components/map/layers/Heatmap.vue | 7 +- components/map/layers/Marker.vue | 27 +-- composables/useExpense.ts | 76 ++++++++- composables/useIdb.ts | 23 +++ lgtm.yml | 6 - package-lock.json | 92 +++++++++- package.json | 3 + pages/index.vue | 271 ++++++++++++++---------------- types/expense.ts | 33 ++++ 10 files changed, 371 insertions(+), 178 deletions(-) create mode 100644 composables/useIdb.ts delete mode 100644 lgtm.yml create mode 100644 types/expense.ts diff --git a/components/map/layers/Cluster.vue b/components/map/layers/Cluster.vue index d62eadc6..9525193d 100644 --- a/components/map/layers/Cluster.vue +++ b/components/map/layers/Cluster.vue @@ -22,7 +22,7 @@ SymbolLayerSpecification, } from 'maplibre-gl'; import type { PropType } from 'vue'; - import type { FeatureCollection, Point } from 'geojson'; + import type { ExpenseFeatureCollection } from '~/types/expense'; import { VLayerMapboxGeojson } from '~/lib/v-mapbox'; export default defineComponent({ @@ -32,7 +32,7 @@ }, props: { data: { - type: Object as PropType>, + type: Object as PropType, required: true, }, visibility: { @@ -43,6 +43,13 @@ }, setup(props) { const cluster = ref({ + // source: { + // type: 'geojson', + // data: props.data, + // cluster: true, + // clusterMaxZoom: 20, + // clusterRadius: 40, + // } as GeoJSONSourceSpecification, source: computed(() => { return { type: 'geojson', diff --git a/components/map/layers/Heatmap.vue b/components/map/layers/Heatmap.vue index 8aac5bd9..9d645f50 100644 --- a/components/map/layers/Heatmap.vue +++ b/components/map/layers/Heatmap.vue @@ -22,7 +22,7 @@ CircleLayerSpecification, } from 'maplibre-gl'; import type { PropType } from 'vue'; - import type { FeatureCollection, Point } from 'geojson'; + import type { ExpenseFeatureCollection } from '~/types/expense'; import { VLayerMapboxGeojson } from '~/lib/v-mapbox'; export default defineComponent({ @@ -32,7 +32,7 @@ }, props: { data: { - type: Object as PropType>, + type: Object as PropType, required: true, }, visibility: { @@ -46,9 +46,6 @@ source: { type: 'geojson', data: props.data, - cluster: true, - clusterMaxZoom: 20, - clusterRadius: 40, } as GeoJSONSourceSpecification, circleLayer: { id: 'expenses-heatmap-circle-layer', diff --git a/components/map/layers/Marker.vue b/components/map/layers/Marker.vue index a059dc2f..ecdc9756 100644 --- a/components/map/layers/Marker.vue +++ b/components/map/layers/Marker.vue @@ -5,6 +5,7 @@ v-if="visibility" :key="idx" :coordinates="getExpenseMarkerCoordinates(marker)" + :popup-options="popupOptions" @click="$emit('update:popup-visibility', true)" >