gregallensworth / L.TileLayer.Cordova

Leaflet TileLayer subclass which caches to local filesystem, for Cordova/Phonegap
MIT License
87 stars 25 forks source link

emptyCache and getDiskUsage are not sensitive to folder+name #23

Closed gregallensworth closed 7 years ago

gregallensworth commented 7 years ago

Create multiple L.TileLayer.Cordova instances, giving them the same directory but different name, which would be pretty standard.

Run some caching e.g. with MobileMapStarter2, on a small area and tally up the file count by watching the console messages.

Now, run getDiskUsage() on each layer individually, and see that they all give back the same number -- the sum total of all layers

Looks like getDiskUsage() does not segregate the files by their prefix, and reports the count+size of all files in its directory

The same likely goes for emptyCache() that it would not segregate files, and would effectively purge cached tiles for all layers sharing the same directory