I installed this JavaScript project which attempts to obtain the user's geolocation using client-side JavaScript.
https://github.com/codejoust/session.js/
The default mechanism for the location lookup is Google's jsapi
feature.
Will Google throttle my app's ability to obtain this information after a certain number of requests?
The function in question looks like this:
gapi_location: function(){
return function(callback){
var location = util.get_obj(options.location_cookie);
if (!location || location.source !== 'google'){
win.gloader_ready = function() {
if ("google" in win){
if (win.google.loader.ClientLocation){
win.google.loader.ClientLocation.source = "google";
callback(win.google.loader.ClientLocation);
} else {
callback({error: true, source: "google"});
}
util.set_cookie(
options.location_cookie,
util.package_obj(win.google.loader.ClientLocation),
options.location_cookie_timeout * 60 * 60 * 1000);
}}
util.embed_script("https://www.google.com/jsapi?callback=gloader_ready");
} else {
callback(location);
}}
},
I think you're not asking about Geocoding, but about location. ClientLocation is deprecated, shouldn't be relied on. I would use HTML5 Geolocation as your first option, as demonstrated in this sample.