0

モバイルにインストールできる現在の位置の詳細を取得するための小さなアプリケーションを構築しています.Geo-Locationを使用して現在の位置の詳細を取得しています.モバイルは特定の期間同じ場所にありますが、地理的位置は異なる住所、緯度、経度を取得.正確な場所の詳細を取得できません。

コード:

function getCurrentLocation()
{

    document.addEventListener("deviceready", onDeviceReady, false);

    function onDeviceReady()
    {

        navigator.geolocation.getCurrentPosition(onSuccess, onError, {maximumAge: 6000, timeout: 60000, enableHighAccuracy: true});
    }
    function onSuccess(position) 
    {
        var latitude=parseFloat(position.coords.latitude); 
        var longitude=parseFloat(position.coords.longitude);
        alert(latitude+" "+longitude);

        var latlng = new google.maps.LatLng(latitude, longitude);
        geocoder.geocode({'latLng': latlng}, function(results, googleStatus) 
        {
            if (googleStatus == google.maps.GeocoderStatus.OK) 
            {
                if (results[0]) 
                { 
                    var arrAddress = results[0].address_components;
                    var address=results[0].formatted_address;
                    insertLocationDetails(address,latitude,longitude);
                } 
            }
        });

    }
    function onError(error) 
    {
        alert('message: ' + error.message );
    }
}

また、現在の位置を正確に取得することに関連する他の概念も提案します。

誰でも私を助けることができますか?

どうもありがとう...!

4

0 に答える 0