mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-07 17:36:35 +00:00
Fix centering map when no entities with zones
This commit is contained in:
parent
53ecbbaa13
commit
d84575e209
@ -75,14 +75,14 @@ Polymer({
|
||||
var bounds;
|
||||
|
||||
if (this._mapItems.length === 0) {
|
||||
bounds = new window.L.latLngBounds(
|
||||
[window.L.latLng(this.locationGPS.latitude, this.locationGPS.longitude)]);
|
||||
this._map.setView(new L.LatLng(this.hass.config.core.latitude,
|
||||
this.hass.config.core.longitude), 14);
|
||||
} else {
|
||||
bounds = new window.L.latLngBounds(
|
||||
this._mapItems.map(function (item) { return item.getLatLng(); }));
|
||||
this._map.fitBounds(bounds.pad(0.5));
|
||||
}
|
||||
|
||||
this._map.fitBounds(bounds.pad(0.5));
|
||||
},
|
||||
|
||||
drawEntities: function (hass) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user