1

My web app's javascript needs to query user's geolocation position every 3 seconds or so but browsers will end up refusing/failing because of google query limits policy.

When calling the javascript function navigator.geolocation.requestgetCurrentPosition(successCallback, errorCallback), in order to gather the user's latitude and longitude coordinates, most browsers query Google's geocoding web service (https://maps.googleapis.com/maps/api/browserlocation/json?browser=googlechrome ...).

That webservice is limited to 2.5k requests per day per client. If you exceed that limit like I did you'll get an OVER_QUERY_LIMIT error.

I understand that you can pay for Google Enterprise to get higher limits, BUT my question is:

When i request user's geolocation from browser (chrome), I just do : navigator.geolocation.getCurrentPosition(), so chrome plugin will be in charge of making the actual call to google geolocation service; therefore, even if i subscribe to Google Enterprise, I 'm not able to send clientID or key to the actual google geolocation webservice because Chrome doesn't provide a function to do that!

Any ideas on how to get around this and get user's coordinates from browser every 3 seconds?

fekke
  • 351
  • 3
  • 10
  • 1
    It has to be every 3 seconds? What if you requested every 12 seconds? – Gerrat Jun 08 '12 at 17:46
  • The Geolocation API: http://dev.w3.org/geo/api/spec-source.html does not have anything to do with Google. So you can query the browser for location as many times as you want. If you want to use Google's services to DO something with that API, then you can pay or hit the limit. – Steve H. Jun 08 '12 at 17:50
  • I will need it to get the position at least every 5 seconds... if I can't exceed current 2.5k queries per day limit I would have to query every 35 seconds. – fekke Jun 08 '12 at 17:53
  • Hi Steve, the API spec does belong to W3C. However every browser implements that API the way its owning organization wants. For example both Chrome and Firefox for non-mobile OSs read nearby wifi hotspot signals and post that information to Google geolocation/geocoding webservices. On the other hand there's nothing else that I know that I can do to get user coordinates from javascript than calling navigator.geolocation.requestgetCurrentPosition(), and there's no way for me to read client's nearby wifi hotspots. – fekke Jun 08 '12 at 17:58
  • Why do you think the user's computer is going to move so much and so quickly that you need to query its location every 3-5 seconds? – Kevin Jun 09 '12 at 17:31
  • You're definitely right, most user's won't move su much and so quickly. However I still need to know when they moved with a 3 to 5 seconds precision. – fekke Jun 10 '12 at 00:41

0 Answers0