Search code examples
androidmapsopenstreetmapofflineosmdroid

Restrict OSMDroid scrolling to a specific bounding box & zoom level


I have tiles downloaded from Mobac tool, with the source being Openstreet mapQuest.

Given that we may not have tiles for all positions at a higher zoom level, when we scroll, areas that are missing tiles result in a null grid or stretched images of lower zoom-level tiles.

How can I restrict scrolling to only a given bounding box and zoom level?


Solution

  • Implementing MapListener interface, I overrode the OnZoom function. Depending upon current zoomlevel and the points visible on screen, the scrollable boundingbox can be set by calling mapView.setScrollableAreaLimit.