MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / sendNotification

Function sendNotification

static/js/map.js:1087–1108  ·  view source on GitHub ↗
(title, text, icon, lat, lng)

Source from the content-addressed store, hash-verified

1085}
1086
1087function 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
1110function createMyLocationButton () {
1111 var locationContainer = document.createElement('div')

Callers 1

customizePokemonMarkerFunction · 0.85

Calls 1

centerMapFunction · 0.85

Tested by

no test coverage detected