public static LatLngBounds buildClickLatLngBounds ( LatLng latLng , View view , GoogleMap map , float screenClickPercentage ) { LatLngBoundingBox latLngBoundingBox = buildClickLatLngBoundingBox ( latLng , view , map , screenClickPercentage ) ; double southWestLongitude = Math . min ( latLngBoundingBox . getLeftCoordinate ( ) . longitude , latLngBoundingBox . getDownCoordinate ( ) . longitude ) ; LatLng southWest = new LatLng ( latLngBoundingBox . getDownCoordinate ( ) . latitude , latLngBoundingBox . getLeftCoordinate ( ) . longitude ) ; LatLng northEast = new LatLng ( latLngBoundingBox . getUpCoordinate ( ) . latitude , latLngBoundingBox . getRightCoordinate ( ) . longitude ) ; LatLngBounds latLngBounds = new LatLngBounds ( southWest , northEast ) ; return latLngBounds ; }
Build a lat lng bounds using the click location map view map and screen percentage tolerance . The bounding box can be used to query for features that were clicked