user1132897
user1132897

Reputation: 1201

Android Mapview pinch view doesn't call the OnZoomListener

My mapview has a OnZoomListener which is called whenever the zoom changes. This works well for whenever the plus or minus buttons at the bottom are used to change the zoom. However, the listener is never called if the user uses pinch zooming in order to zoom in or out. Do you have any suggestions on how to make the pinch zoom actually call my listener? If not, do you have any idea how I can disable the pinch zoom for my mapview? Thanks.

Edit: My custom zoom listener is added like this:

ZoomButtonsController zoomButton = myMapView.getZoomButtonsController();
zoomButton.setOnZoomListener(listener);

Upvotes: 1

Views: 653

Answers (1)

h0m3r16
h0m3r16

Reputation: 303

the problem is that you are setting the listener to the zoom control and not to the map, thats why the pinch (that is a map event not a zoom control event) doesn't call the listener.

The only way to handle this events is to implement a custom map and a custom listener.

This link have the example and the code that you need.

Custom MapView with Events

Upvotes: 2

Related Questions