Maps | On-Premise | 2GIS Documentation


The MapGL JS API service implements a JavaScriptAPI for displaying 2GIS maps in web applications and websites.

The service is an nginx server that allows you to download the main library file (api.js) and the default (light) style for the map (the style directory).

Parameter Recommended value
Number of CPU cores (per pod) 2
Amount of RAM (per pod) 2 GB
Minimum number of pods (for basic fault tolerance) 2

It is recommended to use the Helm chart to install the service.

Caution! The MapGL JS API service must be available for client requests, since the JavaScript library and map style are downloaded directly by the browser.

Before installing the service, you need to specify the repository that stores the downloaded Docker image of the service. To do this, create a YAML file with the following content:


    repository: your-docker-hub/2gis/mapgl-js-api
    tag: 1.0.0

You can also specify additional settings in this file, such as resource limits, use of Ingress, etc.

    repository: your-docker-hub/2gis/mapgl-js-api
    tag: 1.0.0

        cpu: 30m
        memory: 32M
        cpu: 100m
        memory: 64M

Values from this file will be substituted into the configuration templates from the templates directory.

After creating the YAML file, call the helm install command and specify the name of the created file:

helm install mapgl . -f settings.yaml

To update the service after changing the settings or after updating the Docker image, call the helm upgrade command:

helm upgrade mapgl . -f settings.yaml

In addition to the library and style files provided by the MapGL JS API service, you need tiles to display the map. Tiles are square images that form the map (see example). Using tiles allows maps to load dynamically as you move or zoom the map.

Tiles are provided by a separate service called Tileserver API. This service is currently under development and not yet available. Temporarily, the main 2GIS tile servers (tile[0-3] are used to process requests.

To test that the service is working, you can create the following HTML file and open it in a browser. Replace the string with the URL of the published MapGL JS API service.

        <title>MapGL JS API. On-Premise</title>
            #map {
                width: 100%;
                height: 100%;

        <div id="map"></div>
        <script src=""></script>
            const map = new mapgl.Map('map', {
                key: 'your key',
                center: [55.31878, 25.23584],
                style: '',
                styleOptions: {
                    iconsPath: '',
                    fontsPath: '',
                zoom: 13,