GroundOverlay : bug in docs and need help with positioning by 1 point
I used old GroundOverlay this way, as described in the manual:
GroundOverlay myGroundOverlay = new GroundOverlay(this);
myGroundOverlay.setPosition(p);
myGroundOverlay.setImage(getResources().getDrawable(R.drawable.ic_launcher).mutate());
myGroundOverlay.setDimensions(2000.0f);
map.getOverlays().add(myGroundOverlay);
now in the last release it is not possible to do so, because setPosition wants 2 points, and no setDimensions() anymore. Thus the documentation is obsolete :-)
But anyway. How could I workaround this? I know only one point, and I need to just scale my image. I have no bounding box and don't need in complex matrix transformations. Just simply place a picture in a center.
Thanks.
Take care that you have access to 2 different GroundOverlay classes: one in osmdroid, and another one in OSMBonusPack. OSMBonusPack class handles setDimensions. Import the class you really want!
I checked both. Both don't support setDimensions. For example, OSMBonusPack:
https://github.com/MKergall/osmbonuspack/blob/master/OSMBonusPack/src/main/java/org/osmdroid/bonuspack/overlays/GroundOverlay.java
supports only setPositionFromBounds() and no dimensions. Should I import some another version of OSMBonusPack?
Oh sorry, you are right: when I fixed GroundOverlay proper positionning (using Fabrice Fontaine code), setDimensions disapeared. You will have to compute the bounds from the dimension you want. No time to help you short term, but you should find the method you need inside BoundingBox class.
Would you be so kind to point me to the closest previous version of OSMBonusPack, where I could find old-school setDimensions? :-)