angular-openlayers-directive icon indicating copy to clipboard operation
angular-openlayers-directive copied to clipboard

Is there any way to cache the tiles on the client?

Open GaalDornick opened this issue 9 years ago • 2 comments

I am building a mobile app that is essentially a GPS navigation app. I am building it in Ionic, and I am playing around with using this angular-openlayers-directive. It's awesome, I could setup a basic app that tracks the user's position and updates the map in an hour or so.

One of the things that I don't like is that when the user moves into a place with poor network coverage, the tiles appear blank. The Google Maps Javascript API has the same problem BTW. The Google Maps app and Waze don;t have this problem. They cache the tiles in the background while the user is using is the app.

Does openlayers have some way of caching tiles? Does the directive have any way? Is there a way to extend either of them to support caching on the mobile. I was thinking of using a SQLLite database or maybe Amazon Sync to cache data

GaalDornick avatar Aug 25 '16 15:08 GaalDornick

Hmm, I think this is more like a question for the ol3 repository, like what they do to optimize openlayers maps on mobiles and whether there are strategies for caching as you mention. You can then always access the native ol3 map through this angular-openlayers-directive:

.controller('SomeController', function(olData) {
   ...
   olData.getMap().then(function(nativeOl3Map) {
       // access the native ol3 map here
   });

}

juristr avatar Aug 27 '16 08:08 juristr

I think the cache is already implemented. Once you go to a view, and later return wont be any network request of the previous tile

image

dropyghost avatar Sep 14 '16 14:09 dropyghost