gregallensworth / L.TileLayer.Cordova

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

Added utility method calculateXYZListFromBounds(). #6

Closed mmerrill closed 9 years ago

mmerrill commented 9 years ago

Added utility method calculateXYZListFromBounds(), which takes a bounds object (like that obtained by calling MAP.getBounds()), and returns the list of all tiles required to make up that map area (including multiple zoom levels, if desired). Useful for caching an entire view of a map. Updated test application to show this functionality. Tested using Cordova 5.0.0 on Android 4.4.2 and iOS 8.3. To perform this testing, I had to update the project's versions of the android and ios platforms, and install cordova.plugin.whitelist. None of these environmental changes are included in this commit; however, I did include a meta tag in index.html for Content-Security-Policy (to suppress a console warning from cordova-plugin-whitelist).

gregallensworth commented 9 years ago

Very nice. Thank you very much.