added api to show current user location from mobileclient

This commit is contained in:
Jenny Danzmayr 2018-12-22 19:57:42 +01:00
parent fe37983368
commit 4819d67f99
2 changed files with 20 additions and 0 deletions

View file

@ -1394,6 +1394,13 @@ c3nav = {
} else {
$('.locationinput .locate, .leaflet-control-user-location a').text(c3nav._map_material_icon('location_disabled'));
}
if (mobileclient.isCurrentLocationRequested && mobileclient.isCurrentLocationRequested()) {
if (location) {
c3nav._goto_user_location_click();
} else {
mobileclient.currentLocationRequesteFailed()
}
}
},
_goto_user_location_click: function (e) {
e.preventDefault();

View file

@ -46,4 +46,17 @@ mobileclient = {
wificollectorStop: function () {
console.log('wificollectorStop')
},
_currentLocationRequested: false,
isCurrentLocationRequested: function () {
if(mobileclient._currentLocationRequested) {
mobileclient._currentLocationRequested = false;
console.log('isCurrentLocationRequested→true');
return true;
}
console.log('isCurrentLocationRequested→false');
return false;
},
currentLocationRequesteFailed: function () {
console.log('currentLocationRequesteFailed');
},
};