H5 gets location information

Time:2019-10-23

H5 gets location information
function success(position){

Alert (" position obtained successfully ",position.coords);
            
            Document. Write (" dimension ", the position. The coords. Latitude and longitude, the position, coords. Longitude, "coordinate precision," position. The coords. Accuracy)
        }
        function error(positionError){
            Alert (' failed to get location: 'positionError. Code, positionError. The Message)
            document.write(positionError.code,positionError.Message)
        }
        var options = {
            enableHighaccuracy:false,
            timeout:3000,
            maximumAge:0
        }
        if(navigator.geolocation){
            Console.log (" support location ")
            navigator.geolocation.getCurrentPosition(success,error,options)
        }else{
            Alert (" unsupported location ")
        }