Ti.Geolocation has a good start, but is not complete.
Extends Evented.
Methods:
* forwardGeocoder() - call to api.appcelerator.net/p/v1/geo using require()
* getCurrentHeading() - use webkitCompassHeading:
http://tinyurl.com/85a7rjo
* getCurrentPosition()
* reverseGeocoder() - call to api.appcelerator.net/p/v1/geo using require()
Properties:
* distanceFilter - iOS specific, but may be doable
* headingFilter - iOS specific, but may be doable
* preferredProvider - is this doable?
Constants:
* locationServicesEnabled - true if navigator.geolocation is not undefined
Remove all AUTHORIZATION_* constants.
Update API docs show correct support of methods/constants/properties.
Might find some useful bits here:
http://code.google.com/p/geo-location-javascript/source/browse/trunk/js/geo.js
forward and reverse geocoders will remains stubbed out but unimplemented until TIMOB-4880 is resolved.
TIMOB-4880 will not be resolved as per the recent decision to go with mapquest. We should fix this ticket in the current form.
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1573
Here is my relevant nginx config. A proxy must be configured to access api.appcelerator.net.
server { listen 8031; index index.html; autoindex on; root /Users/bhughes/Work/htdocs; proxy_intercept_errors on; location / { if ($request_method = 'OPTIONS') { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; add_header Access-Control-Max-Age 1728000; add_header Access-Control-Allow-Headers "Origin,Content-Type,UserAgent"; add_header Content-Type "text/plain; charset=UTF-8"; return 200; } if ($request_method = 'GET') { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; add_header Access-Control-Max-Age 1728000; add_header Access-Control-Allow-Headers "Origin,Content-Type,UserAgent"; proxy_pass https://api.appcelerator.net; } if ($request_method = 'POST') { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; add_header Access-Control-Max-Age 1728000; add_header Access-Control-Allow-Headers "Origin,Content-Type,UserAgent"; proxy_pass https://api.appcelerator.net; } } }Closing ticket due to MobileWeb no longer being supported.