@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
19 lines (18 loc) • 520 B
JavaScript
;
export const MAPBOX_TOKEN_MISSING_ERROR_MESSAGE = `Set your mapbox token with "poly.thirdParty.mapbox().setToken('<YOUR TOKEN>')" in the PolyConfig.ts file, then reload the page`;
export class PolyThirdPartyMapboxController {
setToken(token) {
this._token = token;
}
setGetTokenFunction(tokenFunc) {
this._getTokenFunc = tokenFunc;
}
async token() {
if (this._token) {
return this._token;
}
if (this._getTokenFunc) {
return await this._getTokenFunc();
}
}
}