OS1 Services
Motion Tracking System

MTS Tiles

13min

Overview

The MTS Maps APIs provide capabilities to manage third-party map service providers, render interactive maps and generate map tiles. This guide covers integrating and using these key mapping features for developers to integrate into their applications.

Key Features

  1. Map Service Provider Management
    • Add and manage third-party map providers.
    • Store provider credentials securely using Secure Data Storage (SDS).
    • Seamlessly switch between providers.
  2. MTS Tiles Service
    • Display interactive maps using map image tiles
    • Customize tile layers based on zoom level and location
    • Integrate popular providers like Mapbox, MapMyIndia, etc.

How it Works

Map Provider Configuration

The MTS service allows configuring and integrating third-party mapping providers, including Google, Mapbox, MapMyIndia, and hereMaps, to render interactive maps.

  • Tenants can register mapping providers at the tenant level by submitting a configuration request. This request specifies provider details like name, type, and credentials.
  • Activating a provider requires entering credentials like API keys. These credentials are securely stored using the SDS (Secret Data Storage) service.
  • After activation, the provider integration status changes to "Active," making it available.
  • MTS APIs use the active mapping providers for rendering maps and related functionality. Calls are routed to the appropriate provider based on configuration.

Map Tiles

MTS uses the concept of map image tiles to render interactive maps.

  • Map tiles are small, square image files representing a part of the map at different zoom levels.
  • Tiles are arranged in a grid system based on an (X, Y) coordinate system for each zoom level.
  • The zoom level indicates the level of detail - higher zoom levels show more detailed views.
  • The MTS Tiles API allows retrieving a tile image by specifying the tile's X and Y coordinates and desired zoom level in the request.
  • The API endpoint determines the active map provider for the tenant based on configuration and fetches the tile from this provider.

Overview of Zoom Levels (Z), X, and Y Coordinates

When working with map tiles in web mapping applications, it's important to understand the relationship between zoom levels (z) and the x and y coordinates. These parameters define which specific part of the map is displayed and at what level of detail.

  • Definition: The zoom level (z) parameter in a map tile API specifies the map's level of detail or scale.
  • Range: Typically, zoom levels range from 0 (the entire world on a single map tile) to higher values (more detailed views). For example, at zoom level 1, the world is divided into four tiles (2x2 grid).
  • Usage: The higher the zoom level, the more tiles are needed to cover the same area with more detail.
  • X Coordinate: Represents the column number of the tile within the grid at the specified zoom level.
  • Y Coordinate: Represents the row number of the tile within the grid at the same zoom level.
  • Calculation: Both x and y coordinates are calculated based on the zoom level. At zoom level 0, there's only one tile (0,0). At zoom level 1, x and y can be 0 or 1, forming a 2x2 grid, and so on.

Permissible Values

  • The permissible values for x and y depend directly on the zoom level z. As z increases, the range of x and y values increases exponentially.
  • For instance, at zoom level 2 (z=2), the world is divided into a 4x4 grid, so x and y can range from 0 to 3.

Refer to the Azure Maps documentation to learn about zoom levels, X and Y coordinates, and how they form the tile grid. It's a useful resource for developers who want to understand how to request and manipulate map data based on these parameters.

APIs

Map Service Provider Management APIs:

  • RegisterMapProviders: Registers a new map provider configuration.
  • GetMapProviders: Get list of configured map providers.
  • GetMapProviderByName: Get details of a specific map provider.
  • UpdateMapProvider: Update configuration of a specific map provider.
  • DeleteMapProvider: Delete a specific map provider configuration. Note that this is hard deletion.

Map Tiles APIs:

  • GetMapTiles: Get a map image tile by specifying x, y coordinates and zoom level.

Integration Flow

Integrating the MTS Maps Service into your application involves Registering your Map Provider and retrieving Map Tiles. Follow the steps below for a detailed walkthrough.

Step 1: Register Map Service Providers

First, you need to register the third-party map provider that will be used as the source of maps/tiles.

Call the RegisterMapProviders API to configure a provider. View the request parameters below:

Parameter

Type

Description

name*

string

Unique name of the map provider integration.

type*

string

3rd party provider name. Should be oneOf ["google", "mapBox", "mapMyIndia", "hereMaps"].

credentials*

object

Contains the credentials for the map provider.

credentials.apiKey*

string

Base64 encoded apiKey of the specific provider. App developers can create an SDS vault and configuration using SDS ID. They can store keys in SDS and view them later.

Sample Request:

create service provider


In this sample:

  • name is set to MyGoogleMapProvider, which is a placeholder for the unique name you would assign to your map provider integration.
  • type is set to google.
  • credentials contains an apiKey field, where your_base64_encoded_api_key should be replaced with the actual base64 encoded API key provided by your map service provider.

Step 2: Get Map Tile

After successfully registering the map provider, you can start retrieving map tiles by calling the GetMapTiles API. View the path and query parameter below: Path Parameters

Parameter

Type

Description

z*

string

Denotes the zoom level of the map tile.

x*

string

Denotes the x coordinate.

y*

string

Denotes the y coordinate.

providerName

string

Denotes the map provider type. Default is "mapTiler" for India tenants and "osm" for US tenants.

Query Parameters

Parameter

Type

Description

providerName

string

Denotes the map provider type. Default is "mapTiler" for India tenants and "osm" for US tenants



In this example, the v1/mts/maps/tiles/3/5/3 request responds with the requested map tile for the Indian subcontinent:

Document image




Updated 21 Feb 2024
Did this page help you?