Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Text from 'ol/style/Text';
import Circle from 'ol/style/Circle';
import Point from 'ol/geom/Point';
import derefLayers from '@mapbox/mapbox-gl-style-spec/deref';
import spec from '@mapbox/mapbox-gl-style-spec/reference/latest';
import {
expression, Color,
function as fn,
featureFilter as createFilter
} from '@mapbox/mapbox-gl-style-spec';
import mb2css from 'mapbox-to-css-font';
import {deg2rad, defaultResolutions, getZoomForResolution, wrapText, applyLetterSpacing} from './util';
const isFunction = fn.isFunction;
const convertFunction = fn.convertFunction;
const isExpression = expression.isExpression;
const createPropertyExpression = expression.createPropertyExpression;
const types = {
'Point': 1,
'MultiPoint': 1,
'LineString': 2,
'MultiLineString': 2,
'Polygon': 3,
'MultiPolygon': 3
};
const expressionData = function(rawExpression, propertySpec) {
const compiledExpression = createPropertyExpression(rawExpression, propertySpec);
if (compiledExpression.result === 'error') {
throw new Error(compiledExpression.value.map(err => `${err.key}: ${err.message}`).join(', '));
}