Skip to main content

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);

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 the horizontally and vertically oriented bounding rectangles enclosing 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