---
title: "Compute zoom and center for a bounding box"
method: GET
path: "/v1/spatial/maps/zoomAndCenter"
tags: ["Mapping Service: Miscellaneous"]
---

# Compute zoom and center for a bounding box

`GET /v1/spatial/maps/zoomAndCenter`

## Request

- Base URL: `https://api.cloud.precisely.com`
- URL: `https://api.cloud.precisely.com/v1/spatial/maps/zoomAndCenter`
- Auth: API key in header `Authorization` and HTTP bearer

Returns a zoom distance and center point that fits the provided bbox into an image of the given width and height

## Query parameters

- `crs` string, required
- `minx` number, required
- `miny` number, required
- `maxx` number, required
- `maxy` number, required
- `width` integer, required
- `height` integer, required

## Response `200`

Zoom and center computed successfully

- ZoomAndCenterResponse: Response containing zoom level and map center point
  - `zoom` Zoom: Zoom distance and center point.
    - `value` number, double, required: Zoom distance value.
    - `unit` string, required: Unit of measure for the zoom distance (e.g. m, km, mi).
    - `centerX` number, double, required: Center point X coordinate.
    - `centerY` number, double, required: Center point Y coordinate.
  - `crs` Crs: GeoJSON Coordinate Reference System (CRS) object.
    - `type` string: CRS object type.
    - `properties` object: CRS properties, e.g. the CRS name/URN.

## Other responses

- `400`: Invalid request parameters
- `500`: Internal server error while processing the request or with downstream services

---

[API](https://skmtc.dev/precisely/apis/mapping-api.md) · [All operations](https://skmtc.dev/precisely/apis/mapping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/precisely/apis/mapping-api/revisions/cea0ad9440c5?raw)
