سؤال

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:

enter image description here

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top