nathan-gs / ha-map-card

A Map Card for Home Assistant
https://community.home-assistant.io/t/map-card-a-slightly-improved-map-card/693088
MIT License
15 stars 4 forks source link

Allow map to default to showing all Markers if no focus_entity or x/y is set. #66

Closed thybag closed 2 weeks ago

thybag commented 3 weeks ago

I believe this should be doable by adding the markers to a L.FeatureGroup, then calling map.fitBounds(markerGroup.getBounds());

This way the default config will just cause the map to show everything tracked rather than focusing on the first entity.

nathan-gs commented 2 weeks ago

I like the idea! An addition to this would be to show the full tracks (as option)

thybag commented 2 weeks ago

As in include the visible location history within the bounds?

That sounds like nice idea, although have to work out best way to get all the history data into a L.FeatureGroup as currently they are on separate layers (unsure if u can just put featureGroups in other featureGroups which would be ideal. ). I do like the idea of map rezooming as history data updates too, which would hopefully be pretty easy to add on top of the above.