In previous versions of Here sdk there was always a function to setup padding. It allows overlapping map with app ui and still centering objects like polyline and polygons inside visible map part.
I can't find similar property in flutter sdk. Is there any alternative?
I checked setPrincipalPoint
(on camera) but it's only changing center point without limiting camera bounds.
Asked
Active
Viewed 241 times
1

obiwanzenobi
- 83
- 5
1 Answers
0
If you want to center objects in the map view, you can try these two options:
mapView.getCamera().getLimits().setTargetArea(route.getBoundingBox());
This will center the route polyline inside the map view.
The second option is to specify a rectangular area (with optional padding):
mapView.getCamera().lookAt​(GeoBox target, GeoOrientationUpdate orientation, Rectangle2D viewRectangle)
This makes the camera look at the specified geodetic area and pass a rectangle which specifies where the area should appear inside of the map view.
The supplied orientation is the orientation of the camera looking at the target, so the resulting camera state will have the same orientation as the one supplied to this method.

Nusatad
- 3,231
- 3
- 11
- 17