Method SetViewInsets
SetViewInsets(Int32, Int32, Int32, Int32)
Gets or sets the viewport padding in pixels.
Declaration
public void SetViewInsets(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | left | Left padding |
System.Int32 | top | Top padding |
System.Int32 | right | Right padding |
System.Int32 | bottom | Bottom padding |
Remarks
The SetViewInsets(Int32, Int32, Int32, Int32) method reduces the "safe area" of the view, so zoom-to, center, rotation etc will be appropriately offset when panels are partially overlaying the view.
For example if you pull out a side-panel that partially covers the map's left side and want to zoom to a geometry without the side-panel blocks the view of the panel,
add some left-view padding equivalent to the width of the side-panel. Ex: mapView.SetViewInsets(sidePanel.Width, 0, 0, 0);
.
If you just want to zoom to a geometry and leave a bit of padding around it, use the SetViewpointGeometryAsync(Geometry, Double) method instead.
The ViewInsets setting currently only applies to MapView, and is ignored on SceneView.
See Also
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Android | 200.3 - 200.5 |
Xamarin.Android | 100.1 - 100.14 |