moagrius / TileView

TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.
MIT License
1.46k stars 337 forks source link

Disable pinch zoom and any zooming #503

Closed shriharsha-bhagwat closed 5 years ago

shriharsha-bhagwat commented 5 years ago

I want to just zoom tileview to a single marker when user open activity and then disable zooming/pinch to zoom. Could you please help?

moagrius commented 5 years ago

In answer to your first question, (animated gif), a quick google looks like it's possible: https://github.com/Miserlou/Android-SDK-Samples/blob/master/ApiDemos/src/com/example/android/apis/graphics/BitmapDecode.java#L103

For the second question, what version are you using? 2 or 3?

shriharsha-bhagwat commented 5 years ago

Animated GIf I could achieve. I will post solution here. For my 2nd question, I am using tileview 2.9. I need help with that. Could you please help?

moagrius commented 5 years ago

to disable pinch to zoom in 2.x, override onScale

@Override
public boolean onScale( ScaleGestureDetector scaleGestureDetector ) {
  return true;
}