problem: the IOS system entered the page for the first time and added if (navigator.geolocation) {}, but did not execute navigator.geolocation.getCurrentPosition (this.showPosition.bind (this), this.showError.bind (this), options);
did not enter showPosition (), nor showError () event
Android machine is normal, this problem will not occur
Code:
if(navigator.geolocation){
console.log(navigator.geolocation);
alert(1);
const options = {
enableHightAcuracy: false, // false
timeout: 6000, //
maximunAge: 30000 //
};
navigator.geolocation.getCurrentPosition(this.showPosition.bind(this), this.showError.bind(this), options);
} else {
console.log("");
alert("");
this.cityName = sessionStorage.getItem(COMMON.CITY_NAME);
this.goPage();
}