1 of 1 people found this helpful
The documentation is all wrong.
It's GeoLocation, not Geolocation! (Note capitalization.)
Oh, maybe they changed in in 4.x? (While still keeping the old capitalization for compatibility?) 2.x documents it as GeoLocation.
My code still works in 4.x.
What version of Rhodes are you using? Make sure you use the correct documentation.
Thanks for that, didnt notice the capital.
That works in Ruby but still not in JS.
Get undefined for GeoLocation (and Geolocation).
I ran console.log(Rho) which returns a list of items similar to those listed here RhoMobile API Summary
but doesnt include Geo[l\L]ocation
As far as Rho version, its what comes with RMS 4.1.0
While I could hack around this, does anyone know how to get gps in JS working?
You can do ajax call to your controller to get the current latitude and longitude.
There is one more way available in rhodes i.e by using HTML tag. Kindly go through the docs available at http://docs.rhomobile.com/en/4.0.0/guide/geolocation
#Asynchronous Ajax calls
If not true, the documentation should be corrected.
The 4.1 docs show the name (apparently) changed from GeoLocation to Geolocation.
I've been converting an app from 2.x to 4.1, and have not yet changed GeoLocation to Geolocation. The code works. I'll test changing it later today.
- in build.yml, include:
- in your layout.html file, include the following files: (order is important, these files must be included exactly in the order shown)
This provides you with a Rho.GeoLocation (note capital L) object, with the following methods:
Those instructions are for 4.0, I have not tested 4.1 yet.