awesomemap.tools


awesome

map

tools

consulting and development

maps, GIS and geospatial software

Cordova map app with Mapbox

Recently, I had the chance to work on a Cordova app using both Laeflet and mapbox-gl-js, using VueJS for the UI components.

In this screencast, I go through the functionality of the app – and sorry for my silly mispronunciation of “mapbox-gl-js” in the video:

If interested, here’s my github repo:
https://github.com/awesomemaptools/cordova-map-02

One of the objectives for this app is that the map works when offline. Hence, it is required to store map data locally on the device. The mapbox-gl-js library is hard-coded to read the data from a server with http requests — so the plan is to write a plugin or fork the code, so that it reads from a local sqlite file on the phone / tablet. Data can be downloaded from here as sqlite files in the ‘.mbtiles’ format:
https://openmaptiles.org/
OpenMapTiles is provided for free by Klokan Technologies.

Reading local mbtiles from mapbox-gl-js has been done before by Trevor Powell, see this article about it on his own website.

I plan to try that approach from his github repo:
https://github.com/trevorpowell/mapbox-gl-js-cordova-offline