(title, text, icon, lat, lng)
| 1085 | } |
| 1086 | |
| 1087 | function sendNotification (title, text, icon, lat, lng) { |
| 1088 | if (!('Notification' in window)) { |
| 1089 | return false // Notifications are not present in browser |
| 1090 | } |
| 1091 | |
| 1092 | if (Notification.permission !== 'granted') { |
| 1093 | Notification.requestPermission() |
| 1094 | } else { |
| 1095 | var notification = new Notification(title, { |
| 1096 | icon: icon, |
| 1097 | body: text, |
| 1098 | sound: 'sounds/ding.mp3' |
| 1099 | }) |
| 1100 | |
| 1101 | notification.onclick = function () { |
| 1102 | window.focus() |
| 1103 | notification.close() |
| 1104 | |
| 1105 | centerMap(lat, lng, 20) |
| 1106 | } |
| 1107 | } |
| 1108 | } |
| 1109 | |
| 1110 | function createMyLocationButton () { |
| 1111 | var locationContainer = document.createElement('div') |
no test coverage detected