Skip to main content

RasterJS API

RasterJS API is a JavaScript library that allows you to add a 2D 2GIS map to your website.

The library allows you to:

  • Create interactive maps on the web page.
  • Display markers, popups, and geometric objects on the map.
  • Determine the coordinates of geoobjects by their names and the names by the coordinates.

For more library usage examples, see the RasterJS API documentation.

The source code of the RasterJS API is available on GitHub, the project is open to suggestions and pull requests.

Tariffs

  • The service fee is calculated based on the number of successful requests per month to the Raster Tiles API service, which provides access to raster map tiles. One request corresponds to loading one raster tile in PNG format of size 256×256 pixels.

  • To determine the exact number of tiles required to display a map:

    1. Determine the map display size in pixels (width and height).
    2. Divide the map width and height by 256 (size of one tile) and round each value up to the nearest integer.
    3. 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 RasterJS API library is provided free of charge.

  • See current prices and rate limits in the Prices section.

Using with Raster Tiles API

You can use the RasterJS API library with the Raster Tiles API service depending on its deployment option:

  • Cloud-based: RasterJS API is available for use with the cloud version of the Raster Tiles API.
  • On-Premise: RasterJS API is not available for use with the Tiles API installed in a private network as the 2GIS API Platform component.

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.

What's next?