RasterTileSource | MapGL | 2GIS Documentation
MapGL JS API

RasterTileSource

Class for creating raster tile source on the map

new constructor(map, options)

Example:

const source = new RasterTileSource(map, {
     url: (x, y, zoom) => `https://tile.openstreetmap.org/${zoom}/${x}/${y}.png`,
     attributes: { foo: 'asd' },
     attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
});
Parameters
map
Map

The map instance

options
RasterTileSourceOptions

Spatial data source options

Returns
Methods