From 081bd98e986a7382d5089fa2557634512df4f9e1 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:29:52 -0800 Subject: [PATCH] Fix map autofit (#18799) --- src/panels/lovelace/cards/hui-map-card.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index c3076985f4cc..f2938140b6c4 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -216,12 +216,13 @@ class HuiMapCard extends LitElement implements LovelaceCard { protected willUpdate(changedProps: PropertyValues): void { super.willUpdate(changedProps); if ( - changedProps.has("hass") && - this._config?.geo_location_sources && - !deepEqual( - this._getSourceEntities(changedProps.get("hass")?.states), - this._getSourceEntities(this.hass.states) - ) + (changedProps.has("hass") && + this._config?.geo_location_sources && + !deepEqual( + this._getSourceEntities(changedProps.get("hass")?.states), + this._getSourceEntities(this.hass.states) + )) || + (this._config?.entities && hasConfigOrEntitiesChanged(this, changedProps)) ) { this._mapEntities = this._getMapEntities(); }