scale(scaleFactor, scaleCenter)
Returns a scaled map rectangle for a map location.
Declaration
scale(scaleFactor: number, scaleCenter?: MapPoint): MapRect;Parameters
- scaleFactor:
The scale factor.
- scaleCenter:
The center map point for scaling.
Discussion
The following example demonstrates scaling a mapkit.MapRect instance first with a common center, and then with a common origin:
const mapRect = new mapkit.MapRect(0.1, 0.2, 0.3, 0.4);
// Scale a MapRect to be 2x the width and 2x the height of mapRect
// and have the same center.
const scaledRect = mapRect.scale(2);
// Same scale but this time mapRect and scaledRectAroundOrigin
// have the same origin rather than the same center.
const scaledRectAroundOrigin = mapRect.scale(2, new mapkit.MapPoint(mapRect.minX(), mapRect.maxX()));