Release 0.1.49: self-hosted maps and consented cloud location history
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import {createFamilyMap} from './controller.js'
|
||||
import './phone.css'
|
||||
const map=createFamilyMap(document.getElementById('map'),{onStatus:text=>document.getElementById('status').textContent=text})
|
||||
// Native layer supplies already-authorized points; no token crosses the WebView boundary.
|
||||
window.ZhaoMap={setItems:items=>map.setItems(items),setTrack:points=>map.setTrack(points),focus:id=>map.focus(id),fit:()=>map.fit(),setNight:value=>{document.documentElement.dataset.theme=value?'night':'day';map.setNight(value)}}
|
||||
document.addEventListener('visibilitychange',()=>{if(document.hidden){map.setItems([]);map.setTrack([])}})
|
||||
window.addEventListener('pagehide',()=>map.setItems([]))
|
||||
const theme=()=>window.ZhaoMap.setNight(new Date().getHours()>=20||new Date().getHours()<7)
|
||||
theme();setInterval(theme,60000)
|
||||
Reference in New Issue
Block a user