Hide map cluster toggle when there is just one entry (#25454)

This commit is contained in:
Wendelin 2025-05-13 11:23:24 +02:00 committed by GitHub
parent 89e04fcc45
commit e1b9b47ac7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -215,17 +215,21 @@ class HuiMapCard extends LitElement implements LovelaceCard {
render-passive render-passive
></ha-map> ></ha-map>
<div id="buttons"> <div id="buttons">
<ha-icon-button ${this._mapEntities.length > 1
.label=${this.hass!.localize( ? html`
"ui.panel.lovelace.cards.map.toggle_grouping" <ha-icon-button
)} .label=${this.hass!.localize(
.path=${this._clusterMarkers "ui.panel.lovelace.cards.map.toggle_grouping"
? mdiGoogleCirclesCommunities )}
: mdiDotsHexagon} .path=${this._clusterMarkers
style=${isDarkMode ? "color:#ffffff" : "color:#000000"} ? mdiGoogleCirclesCommunities
@click=${this._toggleClusterMarkers} : mdiDotsHexagon}
tabindex="0" style=${isDarkMode ? "color:#ffffff" : "color:#000000"}
></ha-icon-button> @click=${this._toggleClusterMarkers}
tabindex="0"
></ha-icon-button>
`
: nothing}
<ha-icon-button <ha-icon-button
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.panel.lovelace.cards.map.reset_focus" "ui.panel.lovelace.cards.map.reset_focus"