/**
* BeNomad BeMap JavaScript API - PMTilesLayer class
* Layer for PMTiles vector tile sources. MapLibre only.
* Requires pmtiles.js library to be loaded.
*/
/**
* @classdesc
* Layer for PMTiles vector tile sources.
* Handles PMTiles protocol registration and authenticated access.
* @public
* @constructor
* @extends {bemap.Layer}
* @param {Object} options See below.
* @param {String} options.url PMTiles file URL (e.g. 'https://server.com/tiles.pmtiles').
* @param {String} options.style Style JSON URL or object for rendering the vector tiles.
* @param {String} options.token Authentication token (e.g. JWT) sent as X-Session-Token header.
* @param {String} options.tokenHeader Custom header name for authentication (default: 'X-Session-Token').
* @param {String} options.sourceName Source name used in the style (default: 'tiles').
* @param {Number} options.maxZoom Max zoom level for the source (default: 14).
* @param {String} options.glyphs URL template for font glyphs.
*/
bemap.PMTilesLayer = function(options) {
var opts = options || {};
/** @type {String} @protected */
this.url = opts.url ? opts.url : null;
/** @type {Object|String} @protected */
this.style = opts.style ? opts.style : null;
/** @type {String} @protected */
this.token = opts.token ? opts.token : null;
/** @type {String} @protected */
this.tokenHeader = opts.tokenHeader ? opts.tokenHeader : 'X-Session-Token';
/** @type {String} @protected */
this.sourceName = opts.sourceName ? opts.sourceName : 'tiles';
/** @type {Number} @protected */
this.pmtilesMaxZoom = opts.maxZoom !== undefined ? opts.maxZoom : 14;
/** @type {String} @protected */
this.glyphs = opts.glyphs ? opts.glyphs : 'https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf';
bemap.Layer.call(this, options);
};
bemap.inherits(bemap.PMTilesLayer, bemap.Layer);