[
https://issues.apache.org/jira/browse/CB-14214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
jcesarmobile closed CB-14214.
-----------------------------
Resolution: Won't Fix
Sorry, but the geolocation plugin on Android just uses the webview
implementation of the geolocation, so we don't really do anything other than
asking for the permissions and we can't fix this neither.
Try reporting it to google as the webview is developed by them.
> Takes 6 to 15 seconds when calling getCurrentPosition in Android
> ----------------------------------------------------------------
>
> Key: CB-14214
> URL: https://issues.apache.org/jira/browse/CB-14214
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-plugin-geolocation
> Environment: Cordova version : 8.0.0
>
> Reporter: Sriram Kalyanasundaram
> Priority: Critical
> Attachments: app-debug.apk, source.zip
>
>
> Location is turned on the phone.It takes 5 to 20 seconds when
> getCurrentPosition method is called.
> Code :
> var app = {
> // Application Constructor
> initialize: function()
> { document.addEventListener('deviceready', this.onDeviceReady.bind(this),
> false); }
> ,
> // deviceready Event Handler
> //
> // Bind any cordova events here. Common events are:
> // 'pause', 'resume', etc.
> onDeviceReady: function()
> { this.receivedEvent('deviceready'); }
> ,
> // Update DOM on a Received Event
> receivedEvent: function(id)
> { var parentElement = document.getElementById(id); var listeningElement =
> parentElement.querySelector('.listening'); var receivedElement =
> parentElement.querySelector('.received');
> listeningElement.setAttribute('style', 'display:none;');
> receivedElement.setAttribute('style', 'display:block;');
> console.log('Received Event: ' + id);
> navigator.geolocation.getCurrentPosition(onSuccess, onError); }
> };
> var onSuccess = function(position)
> { alert('Latitude: ' + position.coords.latitude + '\n' + 'Longitude: ' +
> position.coords.longitude + '\n' + 'Altitude: ' + position.coords.altitude +
> '\n' + 'Accuracy: ' + position.coords.accuracy + '\n' + 'Altitude Accuracy: '
> + position.coords.altitudeAccuracy + '\n' + 'Heading: ' +
> position.coords.heading + '\n' + 'Speed: ' + position.coords.speed + '\n' +
> 'Timestamp: ' + position.timestamp + '\n'); }
> ;
> // onError Callback receives a PositionError object
> //
> function onError(error)
> { alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); }
> app.initialize();
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]