google-maps-api-2

Android map v2 zoom to show all the markers

末鹿安然 提交于 2019-11-26 02:26:51
问题 I have 10 markers in the GoogleMap . I want to zoom in as much as possible and keep all markers in view? In the earlier version this can be achieved from zoomToSpan() but in v2 I have no idea how about doing that. Further, I know the radius of the circle that needs to be visible. 回答1: You should use the CameraUpdate class to do (probably) all programmatic map movements. To do this, first calculate the bounds of all the markers like so: LatLngBounds.Builder builder = new LatLngBounds.Builder()

Google Maps Android API v2 - detect touch on map

梦想与她 提交于 2019-11-26 00:53:17
问题 I can\'t find an example on how to intercept the map touch on the new Google Maps API v2. I need to know when the user touches the map in order to stop a thread (the centering of the map around my current location). 回答1: @ape wrote an answer here on how to intercept the map clicks, but I need to intercept the touches, and then he suggested the following link in a comment of its answer, How to handle onTouch event for map in Google Map API v2?. That solution seems to be a possible workaround,

Google Maps Android API v2 - detect touch on map

╄→尐↘猪︶ㄣ 提交于 2019-11-25 21:17:43
I can't find an example on how to intercept the map touch on the new Google Maps API v2. I need to know when the user touches the map in order to stop a thread (the centering of the map around my current location). Gaucho @ape wrote an answer here on how to intercept the map clicks, but I need to intercept the touches, and then he suggested the following link in a comment of its answer, How to handle onTouch event for map in Google Map API v2? . That solution seems to be a possible workaround, but the suggested code was incomplete. For this reason I rewrote and tested it, and now it works.