Skip to content

Instantly share code, notes, and snippets.

Avatar

Marlow Nickell marlowBlackwood

View GitHub Profile
@marlowBlackwood
marlowBlackwood / geocoderService.js
Last active Jun 3, 2016 — forked from david-meza/geocoderService.js
An AngularJS Service for intelligently geocoding addresses using Google's API. Queries Google's API synchronously to avoid `google.maps.GeocoderStatus.OVER_QUERY_LIMIT`
View geocoderService.js
(function(angular) {
'use strict';
angular.module('geocoder', ['uiGmapgoogle-maps', 'LocalStorageModule']).factory('geocoderService', ['$q', '$timeout', 'uiGmapGoogleMapApi', 'localStorageService',
function ($q, $timeout, mapsApi, localStorage) {
var locations = localStorage.get('locations') ? JSON.parse(localStorage.get('locations')) : {};
var queue = [];