Still not fixed this. I had a look at this:
https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles
and understand that the folder layout for off-line maps should be like this:
/sdcard/osmdroid/
myOsmdroidDatabase.sqlite
/sdcard/osmdroid/tiles/
Have done this and my SQLite db is in /sdcard/osmdroid/
The name of this SQLite db is tmp.sqlite
I can see this SQLite db has the right structure, so the right naming convention.
I have tried numerous ways to access this db, but all failing with the following error:
java.lang.IllegalArgumentException: No such tile source: tmp.sqlite
Instead of tmp.sqlite I also tried with just tmp.
I am using OSMDroid, version 4.1.
This is the code (one of many tries) to show the map:
Sub ShowMap
Dim arrCoordinates() As Double
Dim TileSourceFactory1 As OSMDroid_TileSourceFactory
Dim TS As OSMDroid_TileSource
If File.ExternalWritable=False Then
' OSMDroid requires the use of external storage to cache tiles
' if no external storage is available then the MapView will display no tiles
General.RunLog("WARNING, NO EXTERNAL STORAGE AVAILABLE")
Return
End If
Dim GeoPoint1 As OSMDroid_GeoPoint
arrCoordinates = GetCoordinates
General.RunLog("ShowMap, Lat: " & arrCoordinates(0) & ", Lon: " & arrCoordinates(1))
GeoPoint1.Initialize(arrCoordinates(0), arrCoordinates(1))
MapView1.Initialize("")
MapView1.SetUseDataConnection(False)
'>>>> error here: java.lang.IllegalArgumentException: No such tile source: tmp.sqlite
TS = TileSourceFactory1.GetTileSource("tmp.sqlite") 'tried also "tmp"
General.RunLog("ShowMap, TS.Name: " & TS.Name)
MapView1.SetTileSource(TS)
MapView1.SetMaxZoomLevel(24)
'MapView1.SetBuiltInZoomControls(True)
MapView1.SetMultiTouchControls(True)
'set the zoom before the center
MapView1.GetController.SetZoom(18)
MapView1.GetController.SetCenter(GeoPoint1)
pnlMap.AddView(MapView1, 12, 0, pnlMap.Width, pnlMap.Height)
GotoPanel(ePanelType.ShowMap, False)
End Sub
Any suggestions what is going wrong here?
Any insight in this very greatly appreciated!
RBS