ZenithSource | MapGL | 2GIS Documentation
MapGL JS API

ZenithSource

Class representing Zenith data source.

new constructor(map, options)

Example:

const customZenithSource = new mapgl._J.ZenithSource(map, {
  tileTemplateUrl: `${mapgl._J.ZenithSource.tileTemplateUrl}&user_layer_id=${id}`
  metatileTemplateUrl: `mapgl._J.ZenithSource.metatileTemplateUrl`
  appId: map.state.appId,
  tileServer: map.state.tileServer,
  tileSet: map.state.tileSet,
  tileProtocol: map.state.tileProtocol,
  tileKey: map.state.tileKey,
  subdomains: map.state.subdomains,
  sourceAttributes: {
    sourceName: 'zenith-custom-source',
  }
});

map.setStyle({
  // ...
  layers: [
    // ...
    filter: [
      'all',
      ['match', ['sourceAttr', 'sourceName'], ['zenith-custom-source'], true, false]
      // ...
    ]
  ]
})
Parameters
map
Map

The map instance

options
ZenithSourceOptions

Zenith source options

Returns
Methods