Cache Google Maps client-side geocoding results

569 views Asked by At

I have a PhoneGap application runnning on Android and iOS that currently geocodes a list of addresses. However, if the amount of addresses in the list is too great, the geocoder returns OVER_QUERY_LIMIT. Is it possible to cache geocoding results on the client so that I am not geocoding the same list of addresses every time, perhaps using LocalStorage on the device?

1

There are 1 answers

0
Ivan Gabriele On

You can create a http service over the $http one (without havung to use de $httpProvider). I'm actually developping a reusable one if you want to take some inspiration : https://github.com/ivangabriele/angular-cordova-router.

It's based on LocalStorage. But you can also directly use the original $http caching.

Eventually you can also couple that with the $cacheFactory.

Here is an answer that can help you if you prefers 2nd or 3rd option.