feat: first ask for permission on maps

This commit is contained in:
log101 2024-01-30 20:40:05 +03:00
parent 75a403ddf2
commit 02c2e1b7d0
2 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ L.Control.GoToCurrentLocation = L.Control.extend({
onAdd: function (map) { onAdd: function (map) {
const locationButton = document.createElement('button'); const locationButton = document.createElement('button');
locationButton.textContent = 'Konumuma Git'; locationButton.textContent = 'Konum İzni Ver';
locationButton.classList.add('custom-map-control-button'); locationButton.classList.add('custom-map-control-button');
@ -71,7 +71,7 @@ L.Control.GoToCurrentLocation = L.Control.extend({
locationButton.addEventListener('click', () => { locationButton.addEventListener('click', () => {
if (watchId === -1) { if (watchId === -1) {
startWatchingLocation() startWatchingLocation()
map.setView(currentLocationMarker.getLatLng(), 12); locationButton.textContent = 'Konumuma Git';
} else { } else {
map.setView(currentLocationMarker.getLatLng(), 12); map.setView(currentLocationMarker.getLatLng(), 12);
} }

View File

@ -53,7 +53,7 @@ L.Control.GoToCurrentLocation = L.Control.extend({
onAdd: function (map) { onAdd: function (map) {
const locationButton = document.createElement('button'); const locationButton = document.createElement('button');
locationButton.textContent = 'Konumuma Git'; locationButton.textContent = 'Konum İzni Ver';
locationButton.classList.add('custom-map-control-button'); locationButton.classList.add('custom-map-control-button');
@ -62,7 +62,7 @@ L.Control.GoToCurrentLocation = L.Control.extend({
locationButton.addEventListener('click', (ev) => { locationButton.addEventListener('click', (ev) => {
if (watchId === -1) { if (watchId === -1) {
startWatchingLocation() startWatchingLocation()
map.setView(currentLocationMarker.getLatLng(), 12); locationButton.textContent = 'Konumuma Git';
} else { } else {
map.setView(currentLocationMarker.getLatLng(), 12); map.setView(currentLocationMarker.getLatLng(), 12);
} }