mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix iPhone panning issues
This commit is contained in:
parent
8f13584c14
commit
0be937ee6d
@ -30,14 +30,14 @@
|
|||||||
</paper-toolbar>
|
</paper-toolbar>
|
||||||
|
|
||||||
<div class="flex map">
|
<div class="flex map">
|
||||||
<leaflet-map class="fit" fit-to-markers max-zoom="18">
|
<leaflet-map class="fit" fit-to-markers max-zoom="18" id="map">
|
||||||
<leaflet-divicon id="home" icon-height="45" icon-width="45">
|
<leaflet-divicon id="home" icon-height="45" icon-width="45">
|
||||||
<ha-entity-marker></ha-entity-marker>
|
<ha-entity-marker></ha-entity-marker>
|
||||||
</leaflet-divicon>
|
</leaflet-divicon>
|
||||||
|
|
||||||
<leaflet-marker latitude="[[locationGPS.latitude]]" icon="home"
|
<leaflet-marker latitude="[[locationGPS.latitude]]" icon="home"
|
||||||
longitude="[[locationGPS.longitude]]" title="[[locationName]]"
|
longitude="[[locationGPS.longitude]]" title="[[locationName]]"
|
||||||
></leaflet-marker>
|
no-clickable></leaflet-marker>
|
||||||
|
|
||||||
<template is='dom-repeat' items='[[locationEntities]]'>
|
<template is='dom-repeat' items='[[locationEntities]]'>
|
||||||
<leaflet-divicon id="[[item.entityId]]" icon-height="45" icon-width="45">
|
<leaflet-divicon id="[[item.entityId]]" icon-height="45" icon-width="45">
|
||||||
@ -50,8 +50,8 @@
|
|||||||
|
|
||||||
<template is='dom-if' if='[[item.attributes.gps_accuracy]]'>
|
<template is='dom-if' if='[[item.attributes.gps_accuracy]]'>
|
||||||
<leaflet-circle latitude="[[item.attributes.latitude]]"
|
<leaflet-circle latitude="[[item.attributes.latitude]]"
|
||||||
longitude="[[item.attributes.longitude]]"
|
longitude="[[item.attributes.longitude]]" no-clickable
|
||||||
radius="[[item.attributes.gps_accuracy]]" color="#d00">
|
radius="[[item.attributes.gps_accuracy]]" fill color="#0288D1">
|
||||||
</leaflet-circle>
|
</leaflet-circle>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
@ -44,11 +44,19 @@ export default new Polymer({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: false,
|
value: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
attached() {
|
attached() {
|
||||||
window.el = this;
|
// On iPhone 5, 5s and some 6 I have observed that the user would be
|
||||||
|
// unable to pan on initial load. This fixes it.
|
||||||
|
if (L.Browser.mobileWebkit) {
|
||||||
|
this.async(() => {
|
||||||
|
const map = this.$.map;
|
||||||
|
const prev = map.style.display;
|
||||||
|
map.style.display = 'none';
|
||||||
|
this.async(() => { map.style.display = prev; }, 1);
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computeMenuButtonClass(narrow, showMenu) {
|
computeMenuButtonClass(narrow, showMenu) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user