Went through the tutorial project, SimpleMap and copied that code:
https://www.b4x.com/android/forum/threads/osmdroid-mapview-for-b4a-tutorial.16310/
Have installed OSMDroids_3_0_8 version 3.60. The posted example project works fine, but can't get it to work in my app.
This is my code that loads the map:
GetCoordinates gets the coordinates from SQLite and these coordinates are fine.
The map background shows fine, but no map data. There are no errors. I can't see the difference with the tutorial code, other than that I added the MapView to a panel. Tried adding to activity instead,
but that gives the same result.
Any idea what could be the problem here?
RBS
https://www.b4x.com/android/forum/threads/osmdroid-mapview-for-b4a-tutorial.16310/
Have installed OSMDroids_3_0_8 version 3.60. The posted example project works fine, but can't get it to work in my app.
This is my code that loads the map:
B4X:
Sub ShowMap
Dim arrCoordinates() As Double
arrCoordinates = GetCoordinates
General.RunLog("ShowMap, Lat: " & arrCoordinates(0) & ", Lon: " & arrCoordinates(1))
If MapView1.IsInitialized = False Then
MapView1.Initialize("")
pnlMap.AddView(MapView1, 0, 0, 100%x, 100%y)
'Sleep(2)
End If
'by default the map will zoom in on a double tap and also be draggable - no other user interface features are enabled
'enable the built in zoom controller - the map can now be zoomed in and out
MapView1.SetZoomEnabled(True)
'enable the built in multi touch controller - the map can now be 'pinch zoomed'
MapView1.SetMultiTouchEnabled(True)
'set the zoom level BEFORE the center (otherwise unpredictable map center may be set)
MapView1.Zoom= 18 'max zoom level?
MapView1.SetCenter(arrCoordinates(0), arrCoordinates(1))
GotoPanel(ePanelType.Map, False)
End Sub
GetCoordinates gets the coordinates from SQLite and these coordinates are fine.
The map background shows fine, but no map data. There are no errors. I can't see the difference with the tutorial code, other than that I added the MapView to a panel. Tried adding to activity instead,
but that gives the same result.
Any idea what could be the problem here?
RBS