Sherad
Sherad

Reputation: 55

Android GoogleMaps v2 Scroll limit

I have offline map implemented on GoogleMap (tilesOverly) Everything working fine just the problem is i can scroll outside the offline map.

How i can close the map to BoundBox like in osmdroid scrollAreaLimit?

Upvotes: 0

Views: 260

Answers (1)

MaciejGórski
MaciejGórski

Reputation: 22232

I think the best way currently available to us is to have OnCameraChangeListener, where you check if CameraPosition.target is outside of your defined LatLngBounds and doing GoogleMap.animateCamera to a position inside the bounds.

See this video for how it behaves: http://www.youtube.com/watch?v=-nCZ37HdheY

Upvotes: 2

Related Questions