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

zoom/ scale to bounds #470

Closed anhtuanBk closed 6 years ago

anhtuanBk commented 6 years ago

Hi @moagrius, thanks for this wonderful library ! I'm making a floor plan inspector app base on your library. I wonder is there any build in method to zoom/ scale to fit a bounds, like we do on Google Map ? If not, can you suggest me any way to do it with the library ? Sorry for the trouble ! Btw, i already read #165, but it's only a point, need to focus a bounds, like a hotspot

moagrius commented 6 years ago

like this? https://github.com/moagrius/TileView/issues/468

anhtuanBk commented 6 years ago

Thanks for the reply. It's a bit similar but i just want to slide and fit in a bounds, not restrict scroll or anything. It's like the moveCamera function of google map api. And i must focus a polygon, not a rect so it's kind of complicate

moagrius commented 6 years ago

yeah that's not built in, you'd have to do it manually

anhtuanBk commented 6 years ago

Thanks, i have implemented the feature successfully thank to slideToAndCenter and setScale. I have another issue thought, when i tap a marker inside a hotspot, HotSpotTapListener is triggered. Any way to prevent this ? Because i'm adding marker through HotSpotTapListener

moagrius commented 6 years ago

You could remove the HotSpot with removeHotSpot. You could remove the listener and put it back after. You could set a null listener to that specific HotSpot. Etc.

anhtuanBk commented 6 years ago

i managed to resolve the issue so i will close this. Thanks for the support !