Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
How to use a later version than mapsforge 0.8.0 with the latest (6.0.3) version of osmdroid-mapsforge? #1265
If it's a bug, version(s) of android this affects:
Version of osmdroid the issue relates to:
Description and/or steps/code to reproduce the problem
Try to use osmdroid with mapsforge as it is documented here:
implementation 'org.osmdroid:osmdroid-android:6.0.3' implementation 'org.osmdroid:osmdroid-mapsforge:6.0.3' implementation 'org.mapsforge:mapsforge-themes:0.10.0' implementation 'org.mapsforge:mapsforge-map-android:0.10.0' implementation 'org.mapsforge:mapsforge-map:0.10.0'
Quote from the above documentation page:
//super important to configure some of the mapsforge settings first in your activity onCreate: MapsForgeTileSource.createInstance(this.getApplication());
The implementation of the above method "MapsForgeTileSource.createInstance" (in osmdroid-mapsforge version 6.0.3) will invoke this method:
Therefore the result becomes:
The method ReadBuffer.setMaximumBufferSize seem to have been removed from mapsforge in september 2017:
So, obviously it is not possible to use "MapsForgeTileSource.createInstance" which is currently described as "super important" in the above linked documentation page.
osmdroid 6.0.1 should work with mapsforge 0.8.0 since @MKergall added that version combination into the documentation revision ea98bfb
I tested again, and I confirm that osmdroid 6.0.3 works (fine) with mapsforge 0.8.0.
Important warning: mapsforge 0.8.0 means using mapsforge maps in v4 format (v5 format has been introduced with mapsforge 0.10.0)
Upgrading upcoming osmdroid release to mapsforge 0.10.0 would be a good point.
added a commit
Feb 20, 2019
@TomasJohansson I've just PR'ed #1275, that switches to mapsforge 0.10.0 and removes the
Okay I have now tested to use the code in PR #1275 (i.e. using mapsforge 0.10.0 dependencies with the only java code difference that the invocation of ReadBuffer.setMaximumBufferSize has been removed).
It seems to work. Although I have not tested everything that might be tested, but I have just tested a small experimental app with my tablet, using mapsforge maps with many of the features mentioned at "How to use the osmdroid library
It was a bit surprising to me though that it seems to work with such a small code change considering what was written above regarding it wasn't a straight forward update due to the api changes and no clear path forward.
@TomasJohansson Thank you for your test, in first approach it's good enough for a "go!". Is that a 100% perfect update path: I don't think so, but that will do for the moment.
Same situation here:
try to use mapsforge 0.10.0 with org.osmdroid:osmdroid-mapsforge:6.0.3:
As a workaround I tried to use proguard-rues.pro to remove the call as explainded in https://www.guardsquare.com/proguard/manual/examples#logging with
Any idea how to fix this with proguard while the next osmdroid-release 0.6.0.4 with #1265 (or later) is not available yet?
referenced this issue
Mar 13, 2019
Disclaimer: I'm a bit confused in general with gradle stuff.
If the problem is only at run time, that would make sense to: