Restricting the area the user can go to on Mapview

前端 未结 4 1891
陌清茗
陌清茗 2021-02-10 10:22

I am using a customised version of the mapview (OSMDroid version). I am using custom tiles within it and I only want the user to be able to view the area where I have my custom

4条回答
  •  难免孤独
    2021-02-10 11:19

    I'm looking for exactly the same thing.

    My best lead is to add an Overlay, which extends boolean onScroll(...). If this returns true, then the scroll is cancelled.

    This is exactly how I want it, except for one thing: flinging/flicking. The same approach can be used to cancel fling events, though you only get to hear about it at the start of the fling.

    Ideally, you'd be able to listen to the computeScroll() method, and limit the (x, y) of the scroll, based on mScroller.getCurX() and mScroller.getCurY().

提交回复
热议问题