Map Tiles API
The Map Tiles API service provides vector tiles for maps.
To work with vector tiles, use the MapGL JS API JavaScript library and place 2GIS 3D interactive map, powered by the WebGL, on websites and in web applications. When you purchase a subscription to the Map Tiles API, unlimited access to the MapGL JS API library is provided free of charge.
You can also add maps to mobile applications using the mobile SDKs for iOS, Android, and Flutter.
Direct integration of vector tiles without using a library or SDK 2GIS is not supported.
Getting started
1. Get an access key
-
Sign in to the Platform Manager.
-
Create a demo key or purchase a subscription for using API. For details on service prices, see the Tariffs section.
tipIf you already have an active API key obtained for the MapGL JS API, you can use it to access the Map Tiles API until the subscription expires. You can view the subscription expiration date in the Platform Manager, on the Dashboard tab.
For more information on working with access keys and subscriptions, see the account documentation.
2. Integrate MapGL JS API library
MapGL JS API is a free JavaScript library for working with three-dimensional interactive 2GIS maps. The library contains a ready-made set of tools for interacting with the map, automatically requests vector tiles, and displays them on the page.
To use the tiles provided by the Map Tiles API service with the MapGL JS API library, first obtain an API key, then install the library in your project. For more details, see the Getting started instruction.
Usage example
You can also interact with a ready-made map in the playground (no authorization needed).
Statistics
When limits are reached, the service becomes unavailable. You can track subscription usage and service request distribution statistics in your personal account. For more information about statistics tools, see the Statistics section.
Tariffs
-
The service fee is calculated based on the number of successful requests per month. One request corresponds to loading one vector tile of size 256×256 pixels.
-
To determine the exact number of tiles required to display a map:
- Determine the map display size in pixels (width and height).
- Divide the map width and height by 256 (size of one tile) and round each value up to the nearest integer.
- Multiply the number of horizontal tiles by the number of vertical tiles.
The resulting number is the minimum number of tiles required to display the visible map area. It is recommended to add one extra tile on each side to ensure smooth scrolling and zooming.
For example, to display a map area of 800×600 pixels, you need a minimum of 12 tiles (4 horizontally and 3 vertically) and optimally 30 tiles (6 horizontally and 5 vertically).
-
Unlimited access to the MapGL JS API library is provided free of charge.
-
See current prices and rate limits in the Prices section.
Deployment options
- Cloud-based: Map Tiles API is available through public 2GIS endpoints.
- On-Premise: to get vector tiles, install Tiles API as part of the 2GIS API Platform in a private network. For more information, see the API Platform for server.
Support
-
If you have any questions while working with the API, ask AI assistant (in the lower-right corner of website), use the documentation search, or send an email to api@2gis.com.
-
If you would like to discuss the capabilities of the API or its integration with your product, please contact a manager.