I have a mobile app for which I want to use geolocation. My problem is that I don't understand how to assign the lat / lon to a property in Application.js so I can bind other pages to it.
When I bind the position to a latLon property in Application.js is get: 004930 Assertion error! position is not an data (qx.event.type.Data) event on qx.bom.GeoLocation[99-0].: Expected 'qx.event.type.Data' but found 'qx.event.type.GeoPosition'!
I have tried some variations, but I just can't bind to the property.
I got it working so far that I can debug the location:
  var loginPage = new sgmobile.page.Login();
  manager.addDetail(loginPage);
  loginPage.addListener("appear", function(evvt) {
    this.__getPosition();
  }, this);
  loginPage.show();
 ................
__getPosition : function() {
  var geoLocation = qx.bom.GeoLocation.getInstance();
  var pos = geoLocation.getCurrentPosition();
  geoLocation.addListener("position", this.__applyPosition);
},
__applyPosition : function(position) {
  this.latlon = {
    "lat" : position.getLatitude(),
    "lon" : position.getLongitude()
  }
  this.debug("latlon: " + qx.lang.Json.stringify(this.latlon));
},
I Also copied the mailinglist.
Best Regards, Alex