Skip to content

Instantly share code, notes, and snippets.

@avaliani
avaliani / geocoder-service.js
Last active February 3, 2022 16:13 — forked from benmj/geocoder-service.js
This is a fork of @benmj 's Angular JS Geocoder service. It fixes the following bugs (1) rootscope apply missing, (2) executeNext() not being called if the response type is 'zero results', 'request denied' or 'invalid result', and (3) it simplifies the query pause logic (no increasing pause times and tasks are rejected if we are still over quota…
/*
* An AngularJS Service for intelligently geocoding addresses using Google's API. Makes use of
* localStorage (via the ngStorage package) to avoid unnecessary trips to the server. Queries
* Google's API synchronously to avoid `google.maps.GeocoderStatus.OVER_QUERY_LIMIT`.
*
* @author: benmj
* @author: amir.valiani
*
* Original source: https://gist.github.com/benmj/6380466
*/