Article written by

A passionate pythonist geek looking for problems, to solve :P

5 responses to “Android Map View With Pan & Zoom Events”

  1. Steven Saxton

    Thanks for the code/information.

    I am not exactly an experienced programmer, but can accomplish some things. How ever, I have a question as to how to implement this code. I put a System.out.println inside of the listener in the ObservableMapView class and get results. However, for the life of me, I can’t figure out how to get it to run inside my class that calls ObservableMapVie and builds the actual mapview.

    Basically, I need to run some code inside that class whenever the map is dragged.

    Any insight you could offer me, would be great.


  2. Sandeep Pathivada
  3. Bobkin

    Great solution! But you have a bug – if the zoom level changes, the top-left and bottom-right co-ords will also change, so when you come to calculate the new zoom level you will be passing the *new* co-ordinates in place of the old. You could use a ‘was changed’ boolean to determine whether to update the old co-ordinates.

  4. Bobkin

    Also, if the map view goes from ‘no zoom’ to some zoom level the listener’s onZoom() method will not be called, requiring a further zoom to trigger the method.

Leave a Reply