diff --git a/components/MainMap/MapFeatures.vue b/components/MainMap/MapFeatures.vue index 62cb0a46..71054dbf 100644 --- a/components/MainMap/MapFeatures.vue +++ b/components/MainMap/MapFeatures.vue @@ -124,7 +124,7 @@ export default defineNuxtComponent({ const device = useDevice() const { config } = storeToRefs(useSiteStore()) const mapStore = useMapStore() - const { center, selectedFeature, pinMarker, teritorioCluster } = storeToRefs(mapStore) + const { center, selectedFeature, teritorioCluster } = storeToRefs(mapStore) const mapStyleLoaded = ref(false) return { @@ -134,7 +134,6 @@ export default defineNuxtComponent({ mapBase: ref>(), mapStore, mapStyleLoaded, - pinMarker, selectedFeature, teritorioCluster, } @@ -204,9 +203,6 @@ export default defineNuxtComponent({ }, selectedFeature() { - if (this.pinMarker) - this.pinMarker.addTo(this.map as Map) - this.showSelectedFeature() }, diff --git a/stores/map.ts b/stores/map.ts index ebe5f9c3..e918220c 100644 --- a/stores/map.ts +++ b/stores/map.ts @@ -1,16 +1,14 @@ import { defineStore } from 'pinia' -import { type FitBoundsOptions, type LngLatLike, type Marker, Point } from 'maplibre-gl' +import type { FitBoundsOptions } from 'maplibre-gl' import type { TeritorioCluster } from '@teritorio/maplibre-gl-teritorio-cluster' import type { ApiPoi, ApiPoiProperties } from '~/lib/apiPois' import type { LatLng, Pitch } from '~/utils/types' import { Mode } from '~/utils/types' -import { pinMarkerRender } from '~/lib/clusters' interface State { boundOptions?: FitBoundsOptions center: LatLng mode: Mode - pinMarker: Marker | null pitch: Pitch selectedFeature: ApiPoi | null teritorioCluster: TeritorioCluster | null @@ -21,7 +19,6 @@ export const mapStore = defineStore('map', { boundOptions: undefined, center: { lng: 0, lat: 0 }, mode: Mode.BROWSER, - pinMarker: null, pitch: 0, selectedFeature: null, teritorioCluster: null, @@ -36,9 +33,6 @@ export const mapStore = defineStore('map', { actions: { setSelectedFeature(feature: ApiPoi | null) { - this.pinMarker?.remove() - this.pinMarker = null - if (!feature) { this.selectedFeature = null this.teritorioCluster?.resetSelectedFeature() @@ -68,13 +62,6 @@ export const mapStore = defineStore('map', { }) goodFeature.properties = cleanProperties - - if (feature.properties.internalType === 'address') { - const { coordinates } = feature.geometry as GeoJSON.Point - // @ts-expect-error: type is too deep - this.pinMarker = pinMarkerRender(coordinates as LngLatLike, new Point(0, 0)) - this.teritorioCluster?.resetSelectedFeature() - } } this.selectedFeature = goodFeature