Static Map Tiles Overview

The Static Tiles API delivers a dependable solution for generating high-quality, static map images for your applications. Ideal for web mapping tools, offline navigation systems, and geospatial data visualizations, our API equips you with the means to create visually compelling static maps with ease. By utilizing the Static Tiles API, you gain access to map tiles embedded with detailed geographic data, such as roads, buildings, and land use patterns. Static maps can be a perfect use case to locate stores, show property listings and display neighborhood information and so on.

Why Static Tiles API?

The Static Tiles API is a great choice because it eliminates the need to develop a rendering solution from scratch. With this API, you can effortlessly fetch pre-rendered map images, allowing you to focus on other aspects of your application. This ease of use ensures quick integration, reduces development time, and guarantees consistent, high-quality map visuals with minimal effort. You can layer multiple markers and a polyline on the map, allowing for extensive customization using the various available styles.
If you need a use case where an interactive map is required and you want to use your own rendering platform, you can refer to the Vector Tiles API page. You can also use the Ola Maps Web SDK to render your map tiles which provides a lot of custom support.
The following is a sample response from a static tiles API. It returns a static image containing a map. All respective metadata which is used to compute the map such as location, size and format are passed to the API via parameters.
Description of the image

Parameters:

Path Parameters:
The following parameters are passed as path parameters to the below API contracts. These are used to determine which part of the map is to be fetched as a static image as API response.
Parameter nameDescription
style_nameName of the style you want the static image to be styled upon.
lonLongitude of the center point of the map.
latLatitude of the center point of the map.
zoomZoom level of the map.
bboxBounding box representing upper longitude, upper latitude, lower longitude and lower latitude.
widthWidth of the image.
heightHeight of the image.
formatFormat of the image: JPG or PNG.
Overlay Options:
The following parameters are passed as query parameters to the below API contracts. They are used to overlay entities on top of the map.
MarkerMarker icons/pins which can be overlayed upon the map.
PathSingle line joining a collection of points which can be overlayed upon the map.
Marker:
The following are the attributes to be passed to the marker query parameter.
Parameter nameDescriptionRequired
iconPathLocation of the marker on the map at specified locations. in format lng,lat.True
iconColorColor of the marker.True
scaleScales the image by the factor provided.False
offsetImage will be moved by [offsetX],[offsetY] pixels.False
Path:
The following are the attributes to be passed to the path query parameter.
Parameter nameDescriptionRequired
linePathComma-separated lng,lat and pipe-separated pairsTrue
widthWidth of the line path.False
strokeColor in HEX value of the line path.False

Static Tiles API Types:

The Static Tiles API allows for efficient rendering of static map images. We can use different approaches to render them.

1. Center Based:
Center based API call where longitude, latitude, zoom and size are provided in the request. This latitude, longitude will be the center of the map.
curl --location "https://api.olamaps.io/tiles/v1/styles/{styleName}/static/{lon},{lat},{zoom}/{width}x{height}.{format}?api_key=${your_api_key}" --header "X-Request-Id: XXX"
Sample API Call:
curl --location "https://api.olamaps.io/tiles/v1/styles/default-light-standard/static/77.61,12.93,15/800x600.png?api_key=${your_api_key}" --header "X-Request-Id: XXX"

2. Area Based:
Area based API call where bounding box coordinates of the map and size are provided in the request. A bounding box is a rectangular coordinate system that defines a specific area on a map. This box is represented using upper longitude, upper latitude, lower longitude and lower latitude which establish the location of the four corners of the box. The map will be bound by these coordinates.
curl --location "https://api.olamaps.io/tiles/v1/styles/{styleName}/static/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format}?api_key=${your_api_key}" --header "X-Request-Id: XXX"
Sample API Call:
curl --location "https://api.olamaps.io/tiles/v1/styles/default-light-standard/static/77.611182859373,12.93219851203095,77.61513567417848,12.935739723360513/800x600.png?api_key=${your_api_key}" --header "X-Request-Id: XXX"
The above two static API types also allows users to plot multiple markers and a single polyline on the map.
Sample Center based API Call with marker:
curl --location "https://api.olamaps.io/tiles/v1/styles/default-light-standard/static/77.61,12.93,15/800x600.png?marker=77.61,12.93|red|scale:0.9&api_key=${your_api_key}" --header "X-Request-Id: XXX"
The following static center based API response image contains a marker on the map.
Description of the image
Sample Center based API Call with path:
curl --location "https://api.olamaps.io/tiles/v1/styles/default-light-standard/static/77.61,12.93,15/800x600.png?path=77.61,12.93|77.61190639293811,12.937637130956137|width:6|stroke:green&api_key=${your_api_key}" --header "X-Request-Id: XXX"
The following static center based API response image contains a path/line on the map.
Description of the image
3. Auto Based:
Area based API call where a path/polyline and size are provided in the request. Coordinates of the map are auto calculated based on the path.
curl --location "https://api.olamaps.io/tiles/v1/styles/{styleName}/static/auto/{width}x{height}.{format}?api_key=${your_api_key}" --header "X-Request-Id: XXX"
Sample API Call:
curl --location "https://api.olamaps.io/tiles/v1/styles/default-light-standard/static/auto/800x600.png?path=77.61,12.93|77.61190639293811,12.937637130956137|width:6&api_key=${your_api_key}" --header "X-Request-Id: XXX"

Please refer to theAPI documentationfor further details.