Skip to main content

Maps

1 API call in this section.

Backend map utilities. Static map previews proxy Google Static Maps through the backend so mobile clients do not receive the Google Maps provider key.

Static Route Preview Map​

Delivery & Last-Mile / Maps
GET/maps/static-preview

Returns a Google Static Maps raster image for route preview backgrounds.

Business rules

  • Requires normal backend authentication.

  • Uses the existing google_maps_server provider configuration through MapProviderManager.

  • Does not return the Google Static Maps URL or provider key to the client.

  • Forces maptype=roadmap.

  • Forces Google map styles feature:poi|visibility:off and feature:transit|visibility:off.

  • Sends only map-rendering query data to Google: center, zoom, size, scale, map type, and fixed styles.

Frontend integration contract

  • Use this URL as the React Native image source URI instead of constructing https://maps.googleapis.com/maps/api/staticmap on mobile.

  • Pass Authorization: Bearer <access_token> with the image request.

  • Keep existing overlay marker and route-line rendering unchanged because this endpoint returns only the background raster map image.

Query parameters

ParameterTypeDescription
center_latRequiredstring

Required. Map center latitude. Must be between -90 and 90.

Example: 35.123

center_lngRequiredstring

Required. Map center longitude. Must be between -180 and 180.

Example: 44.123

zoomOptionalstring

Optional. Rounded and clamped to 1..21. Defaults to 13.

Example: 13

widthRequiredstring

Required. Logical image width in pixels. Rounded and clamped to 1..640.

Example: 390

heightRequiredstring

Required. Logical image height in pixels. Rounded and clamped to 1..640.

Example: 168

scaleOptionalstring

Optional. Rounded and clamped to 1..2. Defaults to 2.

Example: 2

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/maps/static-preview?center_lat=35.123&center_lng=44.123&zoom=13&width=390&height=168&scale=2" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200OK

This response has no body.