tombatossals / angular-openlayers-directive

AngularJS directive to embed an interact with maps managed by the OpenLayers library
http://tombatossals.github.io/angular-openlayers-directive/
MIT License
282 stars 183 forks source link

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

Open GaalDornick opened 8 years ago

GaalDornick commented 8 years ago

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

juristr commented 8 years ago

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
   });

}
dropyghost commented 8 years ago

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