home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.79k stars 2.59k forks source link

Map card: map is not centered to a zone #20722

Open ildar170975 opened 1 month ago

ildar170975 commented 1 month ago

Checklist

Describe the issue you are experiencing

Consider the config:

type: map
auto_fit: true
fit_zones: true
entities:
  - entity: zone.borovkovo

The zone.borovkovo is NOT a home zone. But the map card is centered to a home zone. Need to zoom/scroll to see the zone (icon mdi:car): image

According to Docs: image

Describe the behavior you expected

The only zone is placed in the center.

Steps to reproduce the issue

as above

What version of Home Assistant Core has the issue?

2024.5

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome 124.0.6367.92

Which operating system are you using to run this browser?

Win10x64

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

karwosts commented 1 month ago

You are not wrong, but is there an actual usecase for a map with only zones on it? Seems like that would just be a static picture of little use.

ildar170975 commented 1 month ago

Here is a usecase when I observed the issue. There is a integration which creates sensors for temperature, pressure, humidity, radiation, wind speed etc. Each sensor has coordinates. These are data provided by people’s meteo stations - and people expose these data to Internet.

So I add to a Map card a particular zone (assume it is a zone of my country house) and nearby sensors. Sometimes sensors are unavailable - may be caused by lots of reasons. As a result - these sensors are not shown on a map. Since the map is not centered to the zone - I see a home area instead.