moagrius / MapView

(Deprecated, prefer https://github.com/moagrius/TileView) Android widget roughly described as a hybrid between com.google.android.maps.MapView and iOS's CATiledLayer
http://moagrius.github.com/MapView/documentation
69 stars 35 forks source link

Adding ZoomLevels dynamically does not allow zooming. #60

Closed Swiftwork closed 11 years ago

Swiftwork commented 11 years ago

Adding ZoomLevels dynamically through buttons and spinners does not re-calculate the available scale, which in turn allows only panning and not zooming. The issue persists through resetZoomLevels() as well. An additional example is if a default map is loaded and then replaced with a smaller set of tiles, the mapview allows zooming beyond the limits of the new tileset.

I tried finding the cause, but had no luck. I believe that the issue might be that all layouting and drawing methods only happen once during runtime and changes made after do not re-calculate the scale.

Edit: Using setScaleToFit(true) causes the ZoomPanLayout to calculateMinimumScaleToFit() thereby allowing zoom again.

moagrius commented 11 years ago

The new API (TileView) has addressed this issue. I hope to do an initial commit within the next month.