From d84575e209cb0503dadcb32fa76dedaa726b715f Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 13 Feb 2017 23:31:44 -0800 Subject: [PATCH] Fix centering map when no entities with zones --- panels/map/ha-panel-map.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panels/map/ha-panel-map.html b/panels/map/ha-panel-map.html index 7c64e86406..e195bcb9ec 100644 --- a/panels/map/ha-panel-map.html +++ b/panels/map/ha-panel-map.html @@ -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) {