Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25784] Windows: Ti.Geolocation.getCurrentPosition location is not accurate

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionDone
Resolution Date2018-03-02T00:35:43.000+0000
Affected Version/sRelease 7.0.2
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterAminul Islam
AssigneeKota Iguchi
Created2018-02-15T13:31:35.000+0000
Updated2018-03-04T13:04:50.000+0000

Description

Test Code :
function doClick(e) {
 Titanium.Geolocation.preferredProvider = "gps";
 Titanium.Geolocation.purpose = "user coordinates";
 Titanium.Geolocation.distanceFilter = 10;

 Titanium.Geolocation.getCurrentPosition(function(e) {
  if (!e.success || e.error) {
   return;
  }

  var longitude = e.coords.longitude;
  var latitude = e.coords.latitude;
  var altitude = e.coords.altitude;
  var heading = e.coords.heading;
  var accuracy = e.coords.accuracy;
  var speed = e.coords.speed;
  var timestamp = e.coords.timestamp;
  var altitudeAccuracy = e.coords.altitudeAccuracy;
  Titanium.Geolocation.reverseGeocoder(latitude, longitude, function(evt) {
   if (evt.success) {
    var places = evt.places;
    alert('Your Current Location is  : ' + places[0].address + '\n Latitude:' + latitude + '\nLongitude : ' + longitude);

   } else {
    Ti.API.info("Reverse geocoding error");
   }
  });
 });
}

$.index.open();
Test Environment:
Appcelerator Command-Line Interface, version 7.0.2
Copyright (c) 2014-2018, Appcelerator, Inc.  All Rights Reserved.

Operating System
  Name                        = Microsoft Windows 10 Pro
  Version                     = 10.0.16299
  Architecture                = 32bit
  # CPUs                      = 4
  Memory                      = 15.9GB

Node.js
  Node.js Version             = 8.9.1
  npm Version                 = 5.5.1

Titanium CLI
  CLI Version                 = 5.0.14
  node-appc Version           = 0.2.41

Titanium SDKs
  7.0.2.GA
    Version                   = 7.0.2
    Install Location          = C:\ProgramData\Titanium\mobilesdk\win32\7.0.2.GA
    Platforms                 = android, windows
    git Hash                  = 5ef0c56
    git Timestamp             = 2/9/2018 19:02
    node-appc Version         = 0.2.43
  7.0.1.GA
    Version                   = 7.0.1
    Install Location          = C:\ProgramData\Titanium\mobilesdk\win32\7.0.1.GA
    Platforms                 = android, windows
    git Hash                  = f5ae7e5
    git Timestamp             = 12/18/2017 18:45
    node-appc Version         = 0.2.43
  7.0.0.GA
    Version                   = 7.0.0
    Install Location          = C:\ProgramData\Titanium\mobilesdk\win32\7.0.0.GA
    Platforms                 = android, windows
    git Hash                  = f09dec4
    git Timestamp             = 12/5/2017 21:33
    node-appc Version         = 0.2.43
  6.3.0.GA
    Version                   = 6.3.0
    Install Location          = C:\ProgramData\Titanium\mobilesdk\win32\6.3.0.GA
    Platforms                 = android, mobileweb, windows
    git Hash                  = 3620088
    git Timestamp             = 11/1/2017 01:16
    node-appc Version         = 0.2.43
  5.5.1.GA
    Version                   = 5.5.1
    Install Location          = C:\ProgramData\Titanium\mobilesdk\win32\5.5.1.GA
    Platforms                 = android, mobileweb, windows
    git Hash                  = b18727f
    git Timestamp             = 09/27/16 05:38
    node-appc Version         = 0.2.36

IntelĀ® Hardware Accelerated Execution Manager (HAXM)
  Not installed

Java Development Kit
  Version                     = 1.8.0_131
  Java Home                   = C:\Program Files (x86)\Java\jdk1.8.0_131

Thanks

Attachments

FileDateSize
loc.png2018-02-15T13:30:11.000+0000110866

Comments

  1. Kota Iguchi 2018-02-16

    [~aislam] I have Surface Pro 4 device. It may not return accurate location because Surface Pro device doesn't have GPS device unless you have external GPS device attached...It may use WiFi to try to get location but it may not accurate.
  2. Kota Iguchi 2018-02-18

    You'll need physical device, such as external GPS device in order to get correct location.
  3. Kota Iguchi 2018-02-26

    [~mrahman] How different is the result when compared to the actual location? It actually all depends on how precise the build-in GPS system works. You might also want to see if your app has permission to access precise location, by checking [Windows 10 location service setting](https://privacy.microsoft.com/en-us/windows-10-location-and-privacy).
  4. Kota Iguchi 2018-03-02

    Awesome, closing this ticket.

JSON Source