Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    122
    Vote Rating
    3
    clifficious is on a distinguished road

      0  

    Default allowHighAccuracy in Geolocation to use GPS module

    allowHighAccuracy in Geolocation to use GPS module


    REQUIRED INFORMATION ST version tested:
    • 2.0.1.1
    Browser versions tested against:
    • Chrome
    • Android 4.0.4
    Description:
    • GPS module not not being activated when using the Geolocation API
    Steps to reproduce the problem:
    • Build something with Geolocator and allowHighAccuracy = true
    The result that was expected:
    • GPS Module enabled with according accuracy
    The result that occurs instead:
    • only network location provider activated
    Test Case:
    Code:
    geo = Ext.create('Ext.util.Geolocation', {        autoUpdate: true,
            allowHighAccuracy: true,
            frequency: 5000,
            timeout: 30000,
            listeners: {
                locationupdate: function(geo) {
                    var map = Ext.getCmp('map');
                    latlon = new google.maps.LatLng(geo.getLatitude(), geo.getLongitude());
    
    
                    marker = new google.maps.Marker({
                        position: latlon,
                        map: map.getMap()
                    });
    
    
    
    
                },
                locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
                    if(bTimeout){
                        alert('Timeout occurred.');
                    } else {
                        alert('Error occurred.'+message);
                    }
                }
            }
        });
    HELPFUL INFORMATIONScreenshot or Video:
    • Quote Originally Posted by VinylFox View Post
      Sencha Touch version tested:
      • 1.1
      Platform tested against:
      • Android 2.2 (PhoneGap)
      Description:
      • The setting used to enable high accuracy (GPS based) geolocation was changed in 0.99 release to be 'allowHighAccuracy' instead of the standardized 'enableHighAccuracy' property that is defined in the w3c spec. This typo makes it impossible to get a GPS based location update when using PhoneGap, since PhoneGap follows the specifications exactly and will not access the GPS for a location unless 'enableHighAccuracy' is set to true. The change was made in the 0.99 release and has been that way ever since. The following override fixes this problem - I just made the minimal change to get it working, but you might consider fixing the name of the property as it's used in the GeoLocation configuration to match the standard 'enableHighAccuracy' property.
      Fix:

      Code:
      Ext.override(Ext.util.GeoLocation,{
          parseOptions: function(){
              var ret = { 
                  maximumAge: this.maximumAge, 
                  enableHighAccuracy: this.allowHighAccuracy
              };
              //Google doesn't like Infinity
              if(this.timeout !== Infinity){
                  ret.timeout = this.timeout;
              }
              return ret;
          }
      });
      See this URL for the w3 spec: http://dev.w3.org/geo/api/spec-sourc...#high-accuracy

      My Git repo is all messed up right now, so I can't commit this change myself, hopefully someone else can take care of it for me.
    Possible fix:
    • see quote
    • Path: \sdk\src\util
      File: Geolocation.js
      Line: 375
    It's been over a year now (15 Apr 2011 2:20 AM) and this bug is still in the current version of ST2.

  2. #2
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    122
    Vote Rating
    3
    clifficious is on a distinguished road

      0  

    Default


    Sorry, just saw that this bug has been solved for the next release.

    Click here

    Any information on when about the new version is going to be released?

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    It will be part of 2.0.2
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.