1. What is the problem? Be very detailed.
I am using a geopoint widget with style ‘maps’ to collect data and have a raster base layer I created that includes a basemap plus ‘survey points’ overlain (so I can navigate to predetermined points). It works really well avoiding the need to open a separate app with the survey point data loaded... However there is a problem with viewing the raster layer in certain circumstances.
I have loaded the raster MBTiles layer onto my phone in /odk/layers and in General Settings selected map type as:
Mapbox map style: Outdoors
Layer data file: [myfile.MBTiles] (raster format)
I created the MBTiles file with zoom levels 12 - 18
When filling a form with a geopoint widget, type 'map' the reference layer does not show up at any zoom levels unless I have a network connection. Once I have viewed the map online tiles have been cached, the MBTiles layer is then displayed as expected at the different zoom levels. This then works offline. If I move to an area that has not been viewed whilst online the map only displays the raster MBTiles at the zoom level available in the cache, not in the file (i.e. pixelated if I zoom beyond the cached level). So in order to view this locally stored data I need a network connection. I am working in an area with no mobile connection. And this isn’t behaving as an offline map, if I need to have viewed every tile at every zoom level prior to working offline... It also means that anyone else sharing this form would need to know that the map won’t load, and it could be too late once out in the field!
2. What app or server are you using and on what device and operating system? Include version numbers.
3. What you have you tried to fix the problem?
If I connect to the internet via WiFi or 4G I can get the raster MBTiles to show at different zoom levels, which are then cached.
If I tether my phone to another phone which is behaving as a hotspot, the map loads at every zoom level within the MBTiles file, irrespective of whether there is an internet connection on the second phone – i.e. it is not actually dependent on having mapbox base layer data available at that zoom level. Once these tiles have been loaded to cache, the map opens next time at all zoom levels that have been viewed whilst tethered (even if the phone is no longer tethered) – i.e. it appears to be loading from a cache, not reading the MBTiles file directly.
4. What steps can we take to reproduce the problem?
Create MBTiles raster file, place in layers folder, try opening a geopoint with the layer whilst offline – it won’t appear.
Connect to internet or tether to a second phone (fool your phone into thinking it is connected via WiFi) – the MBTiles map will appear.
5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
I discovered the tethering 'trick' purely by luck, and it might not be an expected feature! So if this is the only way to get it to work, please don't 'fix' it by blocking this work around.