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
19 stars 4 forks source link

first render issue - alternative approach #7

Closed Manuel-Materazzo closed 3 months ago

Manuel-Materazzo commented 3 months ago

Alternative approach for the issue discussed here. Should cover basically any resizing-related issues with leaflet even after the first load. Only drawback is the incompatibility with IE and Opera mini.

nathan-gs commented 3 months ago

Looks like in the Home Assistant frontend they use this approach (slightly more extensive): https://github.com/home-assistant/frontend/blob/dev/src/components/map/ha-map.ts#L523

I have a slight preference for this approach, but very open to your suggestions.

Manuel-Materazzo commented 3 months ago

Didn't even cross my mind to check, i guess my map tab has been disabled for too long, might aswell steal some of their code.

nathan-gs commented 3 months ago

@Manuel-Materazzo thanks a lot! It's working indeed.