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.
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 name | Description |
---|
style_name | Name of the style you want the static image to be styled upon. |
lon | Longitude of the center point of the map. |
lat | Latitude of the center point of the map. |
zoom | Zoom level of the map. |
bbox | Bounding box representing upper longitude, upper latitude, lower longitude and lower latitude. |
width | Width of the image. |
height | Height of the image. |
format | Format 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.
Marker | Marker icons/pins which can be overlayed upon the map. |
Path | Single 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 name | Description | Required |
---|
iconPath | Location of the marker on the map at specified locations. in format lng,lat. | True |
iconColor | Color of the marker. | True |
scale | Scales the image by the factor provided. | False |
offset | Image will be moved by [offsetX],[offsetY] pixels. | False |
Path:
The following are the attributes to be passed to the path query parameter.
Parameter name | Description | Required |
---|
linePath | Comma-separated lng,lat and pipe-separated pairs | True |
width | Width of the line path. | False |
stroke | Color 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.
Sample API Call:
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.
Sample API Call:
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:
The following static center based API response image contains a marker on the map.
Sample Center based API Call with path:
The following static center based API response image contains a path/line on the map.
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.
Sample API Call: