MC-9500-K javascript navigation.geolocation gets timeout

// Expert user has replied.
J Jan Zimmermann 2 years 11 months ago
1 1 0

Hi,
 
i have a MC 9500-K with EB 1.3 Webkit and try to get GPS working on Enterprise Browser using javascript.
 
following code:
 
 
var geo_options = {         enableHighAccuracy: true,          maximumAge        : 30000,          timeout           : 5000     };      $scope.errorNr = 1;      $scope.test = function(){         if (navigator.geolocation) {             $scope.watchId = navigator.geolocation.watchPosition(function(position) {                 $timeout(function() {                     $scope.longitude = position.coords.longitude;                     $scope.latitude = position.coords.latitude;                     $scope.time = position.timestamp;                 });             },function(error) {                 $timeout(function() {                     $scope.error = error.message + " " + $scope.errorNr;                     $scope.errorNr = $scope.errorNr + 1;                 });             }, geo_options);         } else {             console.log("Damn..GPS not supported...");         } } 
gets me only a timeout error.
 
on a .net APP on the same Scanner i have GPS working on com2 parsing GPS Scentences by myself.
 
The demo app installed on the Scanner shows also no gps data.
 
Tried to change the port in the external GPS Config from Com8 to Com2 has no Effekt.
 
External GPS Settings:
 
GPS Program port: none
GPS Hardwareport: Com8 /57600
In config xml geolocation is enabled.
 
So what I'am doing wrong?

Please register or login to post a reply

1 Replies

P Pietro Francesco Maggi

Hi Jan,
Just a note that EB v1.4 is now released, you can use it for your own test:
You wrote that you get only a timeout error, did you see anything strange in EB log?
You can try enabling all the logs option in the config.xml so that more information is printed in the log.

One option that you've is to debug your code on the actual device using Chrome DevTools and our Remote Debug inspector: Enterprise Browser 1.4

My understanding is that you're using the HTML5 geolocation API and not the RhoElements legacy GeoLocation API: Rhomobile | GeoLocation API
I think that some of the parameters in our config.xml are targeting this older API.

Best regards
~Pietro

CONTACT
Can’t find what you’re looking for?