-
1 Oct 2012 3:06 AM #1Touch Premium Member
- Join Date
- Feb 2009
- Location
- Firenze, Italia
- Posts
- 156
- Vote Rating
- 0
- Answers
- 1
Unanswered: Ext.device.Geolocation
Unanswered: Ext.device.Geolocation
Hi, with Ext.device.Geolocation.getCurrentPosition(), if failure, it's possible to know the reason like Ext.util.Geolocation (with bTimeout, bPermissionDenied, bLocationUnavailable and message)?
Thanks
Stefano
-
1 Oct 2012 10:23 PM #2Touch Premium Member
- Join Date
- Feb 2009
- Location
- Firenze, Italia
- Posts
- 156
- Vote Rating
- 0
- Answers
- 1
Please, it's important!
-
2 Oct 2012 11:49 PM #3Touch Premium Member
- Join Date
- Feb 2009
- Location
- Firenze, Italia
- Posts
- 156
- Vote Rating
- 0
- Answers
- 1
Anyone? How do I know if the application has not been authorized to use the GPS?
thanks
stefano
-
3 Oct 2012 10:07 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
Have you looked at the Docs?
Code:Ext.device.Geolocation.getCurrentPosition({ success: function(position) { console.log(position.coords); }, failure: function() { console.log('something went wrong!'); } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
8 Oct 2012 6:31 AM #5Touch Premium Member
- Join Date
- Feb 2009
- Location
- Firenze, Italia
- Posts
- 156
- Vote Rating
- 0
- Answers
- 1
Hi mitchells, sure, I've read the docs.
The failure callback don't retur any error object... Ineed to know if the user has disabled localization...
thanks
stefano
-
8 Oct 2012 6:45 AM #6
You can do like this:
Code:var geo = Ext.create('Ext.util.Geolocation', { autoUpdate: false, listeners: { locationupdate: function(geo) { alert('YAY!'); var myPosition = { lat : geo.getLatitude(), lng : geo.getLongitude() }; }, locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) { if(bTimeout){ alert('Timeout occurred.'); } else { alert('Error occurred.'); } } } }); geo.updateLocation();
-
12 Oct 2012 1:54 AM #7Touch Premium Member
- Join Date
- Feb 2009
- Location
- Firenze, Italia
- Posts
- 156
- Vote Rating
- 0
- Answers
- 1
I need to use Ext.device.Geolocation. otherwise I get two GPS request...
thanks
stefano
-
12 Oct 2012 1:56 AM #8


Reply With Quote