1

コードはこの部分で停止し、条件を通過して停止し、コールバックが発生せず、ここで停止し、アプリが配信に失敗します。

src = "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
src = "//maps.google.com/maps?file=api&v=2.x&key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI";

function getLocation() {
    if (navigator && navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(success);
    }
}

function success(position) {
    //Trials.GetLocationService.setLocation("F"); just testing something i commented it out so it's not the proplem
    printAddress(position.coords.latitude, position.coords.longitude);
}

function printAddress(latitude, longitude) {
    // set up the Geocoder object
    var geocoder = new google.maps.Geocoder();

    // turn coordinates into an object
    var yourLocation = new google.maps.LatLng(latitude, longitude);

    // find out info about our location
    geocoder.geocode({ 'latLng': yourLocation }, function (results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            if (results[0]) {
                $('body').append('<p>Your Address:<br />' +
                    results[0].formatted_address + '</p>');
            } else {
                error('Google did not return any results.');
            }
        } else {
            error("Reverse Geocoding failed due to: " + status);
        }
    });
}
4

0 に答える 0