How to ease camera to polygon bounds?
Before v10 I can do it
`LatLngBounds.Builder builder = new LatLngBounds.Builder(); .include(aaaaaaaaaa) .include(bbbbbbbb) .include(cccccccccc)
mapBoxMapView.getMapBoxMap().easeCamera(CameraUpdateFactory.newLatLngBounds( builder.build(), paddingStart, paddingTop, paddingEnd, paddingBottom));`
Now how to do ? Thanks
Originally posted by @xiaxiayige in https://github.com/mapbox/mapbox-maps-android/issues/715#issuecomment-939280584
+1. I have exactly the same question. I don't want to restrict the camera to these bounds, I just want to have the camera positioned to fit the polygon on the screen, with the appropriate zoom level calculated automatically.
I think I've found the answer: https://docs.mapbox.com/android/maps/api/10.0.0-rc.7/-mapbox%20-maps%20-android/com.mapbox.maps/-mapbox-map/#com.mapbox.maps/MapboxMap/cameraForCoordinateBounds/#com.mapbox.maps.CoordinateBounds#com.mapbox.maps.EdgeInsets#kotlin.Double?#kotlin.Double?/PointingToDeclaration/
This works for me, but I'm then hitting the issue described in https://github.com/mapbox/mapbox-maps-android/issues/611.
@djavid @samcrawford Thank you for reaching out. I have reproduced this behavior with the latest version of our SDK. At the moment, we are awaiting a fix from another team which will resolve this issue.
hey, are there any updates? we try to use mapboxMap.setCamera(mapboxMap.cameraForGeometry(polygon, EdgeInsets(1.0, 1.0, 1.0, 1.0))) and it doesn't seem to work, points zoomed far out of the polygon's bounds. Same for easeTo