Fix InfoPanel map: hide toggle, show current entity, auto-center
All checks were successful
Build Docker Image / build (push) Successful in 4m18s

- Hide view mode toggle (offers/hubs/suppliers) when in InfoPanel mode
- Add current entity to relatedPoints so it's visible on the map
- Auto-fit map bounds to show all points (current + related) in InfoPanel mode
This commit is contained in:
Ruslan Bakiev
2026-01-27 11:25:57 +07:00
parent 80474acc0f
commit ff34c564e1
3 changed files with 53 additions and 21 deletions

View File

@@ -693,13 +693,26 @@ watch(() => props.hoveredItem, () => {
}
}, { deep: true })
// Update related points layer when relatedPoints changes
watch(() => props.relatedPoints, () => {
// Update related points layer when relatedPoints changes + fit bounds
watch(() => props.relatedPoints, (points) => {
if (!mapRef.value || !mapInitialized.value) return
// Update the source data
const source = mapRef.value.getSource(relatedSourceId.value) as mapboxgl.GeoJSONSource | undefined
if (source) {
source.setData(relatedPointsGeoJson.value)
}
// Fit bounds to show all related points (Info mode)
if (points && points.length > 0) {
const bounds = new LngLatBounds()
points.forEach(p => {
bounds.extend([p.longitude, p.latitude])
})
if (!bounds.isEmpty()) {
mapRef.value.fitBounds(bounds, { padding: 80, maxZoom: 12 })
}
}
}, { deep: true })
// Watch for pointColor or entityType changes - update colors and icons