background preloader

Leaflet

Facebook Twitter

Phonegap 3.0 + Leaflet + Offline maps | David Rust-Smith. I am working on an app that requires offline maps for a known region, in my case the city of Ottawa. I am using Phonegap 3.0 for app development, Leaflet.js as my mapping library, and MobileAtlasCreator to download my tile package. I have my code working and have created a git repo here: Step 1: Create Map Tiles Download MobileAtlasCreator: Save Atlas as OSMdroid ZIP. This will create a zip folder of the image tiles you need in the format: {atlas_name}/{z}/{x}/{y}.png Step 2: Add Mapt Tiles to PhoneGap Extract this folder of map tiles into your Phonegap’s www/img folder Step 3: Point Leaflet map to offline location Change your leaflet code to point to local files.

Original online map code New offline code Geolocation Plugin added to project on another computer, developing for iOS, doesn’t work on my computer, developing for android. Research tradeoffs of database vs separate files.