diff --git a/src/components/BikeMarker.vue b/src/components/BikeMarker.vue new file mode 100644 index 0000000..3b2a06b --- /dev/null +++ b/src/components/BikeMarker.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/components/Map.vue b/src/components/Map.vue index d15f8a2..0e64b5f 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -2,18 +2,17 @@ import 'leaflet/dist/leaflet.css' import 'vue-leaflet-markercluster/dist/style.css' -import L, { type PointTuple } from 'leaflet' +import L from 'leaflet' globalThis.L = L +import { useMap } from '@/stores/map' import type { ApiResponse } from '@/types/Api' import type { BikeParking } from '@/types/Bikes' import { API_BASE_URL, API_LIMIT } from '@/utils/const' import { useQuery } from '@pinia/colada' -import { LControlZoom, LIcon, LMap, LMarker, LPopup, LTileLayer } from '@vue-leaflet/vue-leaflet' +import { LControlZoom, LMap, LTileLayer } from '@vue-leaflet/vue-leaflet' import { LMarkerClusterGroup } from 'vue-leaflet-markercluster' -import { useMap } from '@/stores/map' -import { computed, ref } from 'vue' -import { PhBicycle } from '@phosphor-icons/vue' +import BikeMarker from './BikeMarker.vue' async function fetchAllBikeParkings(): Promise { const firstPage = await fetch(`${API_BASE_URL}?limit=${API_LIMIT}`).then(r => r.json()) as ApiResponse @@ -38,11 +37,6 @@ const { state } = useQuery({ }) const { zoom, minZoom, center } = useMap() -const normalIconSize: PointTuple = [30, 30] - -const iconSize = ref(normalIconSize) -const iconAnchor = computed(() => [iconSize.value[0] / 2, iconSize.value[1]]) -const popupOffset = [0, iconSize.value[0] * -0.66] diff --git a/src/stores/map.ts b/src/stores/map.ts index 183e3f9..a246b64 100644 --- a/src/stores/map.ts +++ b/src/stores/map.ts @@ -3,9 +3,9 @@ import { defineStore } from 'pinia' import { ref } from 'vue' export const useMap = defineStore('map', () => { - const zoom = ref(7) - const minZoom = 4 - const center = ref([47.809376, -0.637207]) + const zoom = ref(10) + const minZoom = 6 + const center = ref([48.11180645878813, -1.6637869497745246]) return { zoom,