MAPC / trailmap2

Multi-use trail map application.
https://trailmap.mapc.org/
0 stars 0 forks source link

Ember-Leaflet-Tile-Cache not updating Carto-Leaflet #5

Closed allthesignals closed 7 years ago

allthesignals commented 7 years ago

Ember-Leaflet-Tile-Cache is an addon that forces TileLayer class to store tiles in IndexedDB for offline use. They work for the regular Ember-Leaflet TileLayer tiles, but not for the Ember-Leaflet-Cartodb addon tiles.

What's probably happening: the tile-cache addon isn't extending the TileLayer class before CartoDB uses it, so those tiles aren't being cached. It's for some reason a little tricky to get Ember to load packages in a certain order - you basically have to fork the addon and change the package.json.

This is worth working on, and there's a path forward, but need to research more. I'm hearing it's not a huge priority, so I'm going to move on.

allthesignals commented 7 years ago

Include the library with Leaflet and include L.TileLayer.prototype.options.useCache = true; with CartoDB.js. Not sure how Carto works with extending things, but it must not be playing nicely.