UNPKG

mmr-gl-react

Version:

React components for MMR GL JS-compatible libraries

30 lines 967 B
const globalSettings = [ 'baseApiUrl', 'maxParallelImageRequests', 'workerClass', 'workerCount', 'workerUrl' ]; export default function setGlobals(mapLib, props) { for (const key of globalSettings) { if (key in props) { mapLib[key] = props[key]; } } if (props.vkAccessToken) mapLib.accessToken = props.vkAccessToken; if (props.vkBaseApiUrl) mapLib.baseApiUrl = props.vkBaseApiUrl; const { RTLTextPlugin = 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js' } = props; if (RTLTextPlugin && mapLib.getRTLTextPluginStatus && mapLib.getRTLTextPluginStatus() === 'unavailable') { mapLib.setRTLTextPlugin(RTLTextPlugin, (error) => { if (error) { // eslint-disable-next-line console.error(error); } }, true); } } //# sourceMappingURL=set-globals.js.map