I use OSMdroid of the version 3.0.10 in my project. And I want to disable scrolling on MapView. I tried:
setFocusable(false)
setEnabled(false)
setClickable(false)
methods of MapView with no results. Is there any way to disable scrolling the map?
Thank in advance.
The quickest solution is to subclass MapView
and override scrollTo()
. Instead of calling super.scrollTo(x,y)
with the x and y parameters that were passed in, call it with the scroll values you want the maps permanently locked to.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.