我正在通过 phonegap 构建一个带有地理定位按钮的应用程序。
如果用户第一次拒绝地理定位许可,当他们再次单击地理定位按钮时,我如何再次请求许可?
我目前的代码结构是:
function getLocation() {    
    if(navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition, positionError);
    } else {
        hideLoadingDiv()
        showError('Geolocation is not supported by this device')
    }
}
function positionError() {
    hideLoadingDiv()
    showError('Geolocation is not enabled. Please enable to use this feature')
}
