mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 09:56:36 +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;
|
var bounds;
|
||||||
|
|
||||||
if (this._mapItems.length === 0) {
|
if (this._mapItems.length === 0) {
|
||||||
bounds = new window.L.latLngBounds(
|
this._map.setView(new L.LatLng(this.hass.config.core.latitude,
|
||||||
[window.L.latLng(this.locationGPS.latitude, this.locationGPS.longitude)]);
|
this.hass.config.core.longitude), 14);
|
||||||
} else {
|
} else {
|
||||||
bounds = new window.L.latLngBounds(
|
bounds = new window.L.latLngBounds(
|
||||||
this._mapItems.map(function (item) { return item.getLatLng(); }));
|
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) {
|
drawEntities: function (hass) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user