TdxCustomMapControl.ZoomToFitItems(TdxMapItemList,Double) Method
Centers and zooms the map on specified map items, with optional padding around them.
Declaration
procedure ZoomToFitItems(AItems: TdxMapItemList; const APaddingFactor: Double = dxMapControlDefaultZoomPaddingFactor); overload;
Parameters
| Name | Type |
|---|---|
| AItems | TdxMapItemList |
| APaddingFactor | Double |
Remarks
This procedure is similar to ZoomToGeoRect, except that it calculates a bounding rectangle for map items passed as the AItems parameter, and then performs zooming and padding on this rectangle. Refer to the ZoomToGeoRect procedure description to learn about the APaddingFactor parameter specifics.
The following image illustrates how the 0.3 padding factor applies to horizontally and vertically oriented bounding rectangles that enclose four pushpin items on a map.

Note
The ZoomToFitItems procedure iterates through AItems and takes into account only visible map items and only those whose layer is rendered on the map.
See Also