venkivenkat / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

listen map events #459

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I need listen follow map events:
1.on  MotionEvent.ACTION_DOWN
2.on  MotionEvent.UP
3.on map moving
4. on map moved
5.on map zooming
6.on map zoomed

I find MapEvent,But it can't meet the above requirements.
any idea can help me ?

if you not understand what I say,please read follow words for Chinese:
我想监听地图事件:
1.按下地图事件
2.按下后再松开地图事件
3.移动地图事件
4.移动地图完成后事件
5.放大或缩小时地图事件
6.放大或缩小完成后地图事件

Original issue reported on code.google.com by zhengfaz...@gmail.com on 6 Aug 2013 at 2:13

GoogleCodeExporter commented 9 years ago
You can extend MapView and override onTouchEvent() or you can create your own 
Overlay and override onTouchEvent(). That will handle 1-4.

For the zoom events, you can extend MapView and override zoomIn()/zoomOut() for 
#5 and setZoomLevel for #6.

Another way to do it is to create a MapListener and call setMapListener() on 
your MapView which will give you scroll and zoom events.

Original comment by kurtzm...@gmail.com on 6 Aug 2013 at 4:52