I am using osmdroid version 4 and I want to have BoundingBox of visible map. It seems that MapView.getBoundingBox
method returns bounding box of all tiles that are visible or partially visible. Take a look at this picture:
Black rectangles are tiles, red rectangle with rounded corners is device display.
I want to have only diagonal area shown by green line. What should I do?
I believe you are mistaken. getBoundingBox() returns the lat/long boundaries of what is visible on the screen. The code will take the pixel x,y value of the two corners and covert that into lat/long and that is what is used. It is not "snapped" to actual map tiles. The result of getBoundingBox() should return the area of the red box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With