Lovelace map: hide overflow, reset focus button (#1421)

* Lovelace map: hide overflow, reset focus button

* Increase margin for better clicking
This commit is contained in:
c727 2018-07-08 15:03:56 +02:00 committed by Paulus Schoutsen
parent c17f390f58
commit b0f29744bf

View File

@ -1,5 +1,6 @@
import { html } from '@polymer/polymer/lib/utils/html-tag.js'; import { html } from '@polymer/polymer/lib/utils/html-tag.js';
import { PolymerElement } from '@polymer/polymer/polymer-element.js'; import { PolymerElement } from '@polymer/polymer/polymer-element.js';
import '@polymer/paper-icon-button/paper-icon-button.js';
import Leaflet from 'leaflet'; import Leaflet from 'leaflet';
import '../../map/ha-entity-marker.js'; import '../../map/ha-entity-marker.js';
@ -28,6 +29,10 @@ class HuiMapCard extends PolymerElement {
position: absolute; position: absolute;
} }
ha-card {
overflow: hidden;
}
#map { #map {
z-index: 0; z-index: 0;
border: none; border: none;
@ -38,6 +43,12 @@ class HuiMapCard extends PolymerElement {
height: 100%; height: 100%;
} }
paper-icon-button {
position: absolute;
top: 75px;
left: 7px;
}
#root { #root {
position: relative; position: relative;
} }
@ -50,6 +61,11 @@ class HuiMapCard extends PolymerElement {
<ha-card id="card" header="[[_config.title]]"> <ha-card id="card" header="[[_config.title]]">
<div id="root"> <div id="root">
<div id="map"></div> <div id="map"></div>
<paper-icon-button
on-click="_fitMap"
icon="hass:image-filter-center-focus"
title="Reset focus"
></paper-icon-button>
</div> </div>
</ha-card> </ha-card>