Android Question MapsForge ERROR "no map file is currently opened"

PamazFit

Member
Licensed User
Hi,

I am trying to view an Offline MapsForge Map, but every code I have made Errors in:
java.lang.IllegalStateException: no map file is currently opened.

The code i have used (OSM Droid v4.1) comes from:
https://www.b4x.com/android/forum/t...ew-for-b4a-tutorial.16310/page-24#post-338403

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")

    ' OSM 4.1 library used
    Private osmMaps As OSMDroid_MapView
    Private MFTSrc As MapsForgeTileSource

    MFTSrc.GetMapsForgeTileSourceOptions.SetMapDatabaseFile(File.DirRootExternal, "monaco.map")
    MFTSrc.GetMapsForgeTileSourceOptions.SetTileSourceName("MyOwnMap")
    
    MFTSrc.Initialize    
    
    osmMaps.Initialize("osmMap")

    osmMaps.SetUseDataConnection(True)
    osmMaps.SetTileSource(MFTSrc)

End Sub


Errors with the message:
java.lang.IllegalStateException: no map file is currently opened

On line:
MFTSrc.Initialize



Martins example code 'MapsForgeTileSource 20140308' for OSMDroid_3_0_8_v3.60
http://b4a.martinpearman.co.uk/osmdroid/MapsForgeTileSource 20140308.zip

Throws the same error:

java.lang.IllegalStateException: no map file is currently opened

line 45 : MapsForgeTileSource1.Initialize


Any help is much appreciated.
 

PamazFit

Member
Licensed User
Asking once again as I like to get this working.

Is anybody still using this library or is there another or better way?

Hope someone could please give me some help with this.
Thanks.
 
Upvote 0
Top