Add map view toggle for fullWidthMap mode
All checks were successful
Build Docker Image / build (push) Successful in 3m25s
All checks were successful
Build Docker Image / build (push) Successful in 3m25s
- Add MapViewMode type (offers/hubs/suppliers) with cookie storage - Add view toggle button group on full-width map - Update clusterNodeType and mapPointColor based on selected view - Add translations for view options
This commit is contained in:
@@ -87,7 +87,9 @@ const {
|
||||
selectItem,
|
||||
removeFilter,
|
||||
editFilter,
|
||||
setLabel
|
||||
setLabel,
|
||||
mapViewMode,
|
||||
entityColors
|
||||
} = useCatalogSearch()
|
||||
|
||||
// Composables for data
|
||||
@@ -140,6 +142,12 @@ const useServerClustering = computed(() => {
|
||||
})
|
||||
|
||||
const clusterNodeType = computed(() => {
|
||||
// When in full width map mode, use mapViewMode preference
|
||||
if (!selectMode.value) {
|
||||
if (mapViewMode.value === 'offers') return 'offer'
|
||||
if (mapViewMode.value === 'hubs') return 'logistics'
|
||||
if (mapViewMode.value === 'suppliers') return 'supplier'
|
||||
}
|
||||
// For products/offers/default map show offer locations
|
||||
if (['map-default', 'grid-products', 'grid-offers', 'grid-products-from-supplier', 'grid-products-in-hub'].includes(displayMode.value)) {
|
||||
return 'offer'
|
||||
@@ -148,10 +156,13 @@ const clusterNodeType = computed(() => {
|
||||
return 'logistics'
|
||||
})
|
||||
|
||||
// Import entity colors
|
||||
const { entityColors } = useCatalogSearch()
|
||||
|
||||
const mapPointColor = computed(() => {
|
||||
// When in full width map mode, use mapViewMode preference
|
||||
if (!selectMode.value) {
|
||||
if (mapViewMode.value === 'offers') return entityColors.offer // orange
|
||||
if (mapViewMode.value === 'hubs') return entityColors.hub // green
|
||||
if (mapViewMode.value === 'suppliers') return entityColors.supplier // blue
|
||||
}
|
||||
if (cardType.value === 'supplier') return entityColors.supplier // blue
|
||||
if (cardType.value === 'hub') return entityColors.hub // green
|
||||
if (cardType.value === 'offer') return entityColors.offer // orange
|
||||
|
||||
Reference in New Issue
Block a user