ol-mapbox-style
Version:
Create OpenLayers layers or maps from Mapbox/MapLibre styles
59 lines (58 loc) • 2.02 kB
TypeScript
/**
* @typedef {Object} Sprite
* @property {string} id Id of the sprite source.
* @property {string} url URL to the sprite source.
*/
/**
* Gets the path from a mapbox:// URL.
* @param {string} url The Mapbox URL.
* @return {string} The path.
* @private
*/
export function getMapboxPath(url: string): string;
/**
* Normalizes legacy string-based or new-style array based sprite definitions into array-based.
* @param {string|Array<Sprite>} sprite the sprite source.
* @param {string|undefined} token The access token.
* @param {string} styleUrl The style URL.
* @return {Array<Sprite>} An array of sprite definitions with normalized URLs.
* @private
*/
export function normalizeSpriteDefinition(sprite: string | Array<Sprite>, token: string | undefined, styleUrl: string): Array<Sprite>;
/**
* Turns mapbox:// sprite URLs into resolvable URLs.
* @param {string} url The sprite URL.
* @param {string|undefined} token The access token.
* @param {string} styleUrl The style URL.
* @return {string} A resolvable URL.
* @private
*/
export function normalizeSpriteUrl(url: string, token: string | undefined, styleUrl: string): string;
/**
* Turns mapbox:// style URLs into resolvable URLs.
* @param {string} url The style URL.
* @param {string} [token] The access token.
* @return {string} A resolvable URL.
* @private
*/
export function normalizeStyleUrl(url: string, token?: string): string;
/**
* Turns mapbox:// source URLs into vector tile URL templates.
* @param {string} url The source URL.
* @param {string|undefined} token The access token.
* @param {string} tokenParam The access token key.
* @param {string} styleUrl The style URL.
* @return {Array<string>} A vector tile template.
* @private
*/
export function normalizeSourceUrl(url: string, token: string | undefined, tokenParam: string, styleUrl: string): Array<string>;
export type Sprite = {
/**
* Id of the sprite source.
*/
id: string;
/**
* URL to the sprite source.
*/
url: string;
};