public BoundingBox buildClickBoundingBox ( LatLng latLng , BoundingBox mapBounds ) { // Get the screen width and height a click occurs from a feature double width = TileBoundingBoxMapUtils . getLongitudeDistance ( mapBounds ) * screenClickPercentage ; double height = TileBoundingBoxMapUtils . getLatitudeDistance ( mapBounds ) * screenClickPercentage ; LatLng leftCoordinate = SphericalUtil . computeOffset ( latLng , width , 270 ) ; LatLng upCoordinate = SphericalUtil . computeOffset ( latLng , height , 0 ) ; LatLng rightCoordinate = SphericalUtil . computeOffset ( latLng , width , 90 ) ; LatLng downCoordinate = SphericalUtil . computeOffset ( latLng , height , 180 ) ; BoundingBox boundingBox = new BoundingBox ( leftCoordinate . longitude , downCoordinate . latitude , rightCoordinate . longitude , upCoordinate . latitude ) ; return boundingBox ; }
Build a bounding box using the location coordinate click location and map view bounds