Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { ResizeChecker } from 'ui/resize_checker';
import { syncLayerOrder, removeOrphanedSourcesAndLayers, createMbMapInstance } from './utils';
import {
DECIMAL_DEGREES_PRECISION,
FEATURE_ID_PROPERTY_NAME,
ZOOM_PRECISION
} from '../../../../common/constants';
import mapboxgl from 'mapbox-gl';
import MapboxDraw from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw-unminified';
import DrawRectangle from 'mapbox-gl-draw-rectangle-mode';
import { FeatureTooltip } from '../feature_tooltip';
import { DRAW_TYPE } from '../../../actions/store_actions';
import { filterBarQueryFilter } from '../../../kibana_services';
import { createShapeFilterWithMeta, createExtentFilterWithMeta } from '../../../elasticsearch_geo_utils';
const mbDrawModes = MapboxDraw.modes;
mbDrawModes.draw_rectangle = DrawRectangle;
const TOOLTIP_TYPE = {
HOVER: 'HOVER',
LOCKED: 'LOCKED'
};
export class MBMapContainer extends React.Component {
state = {
isDrawingFilter: false,
prevLayerList: undefined,
hasSyncedLayerList: false,
};
static getDerivedStateFromProps(nextProps, prevState) {
*/
import _ from 'lodash';
import React from 'react';
import { DRAW_TYPE } from '../../../../../common/constants';
import MapboxDraw from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw-unminified';
import DrawRectangle from 'mapbox-gl-draw-rectangle-mode';
import {
createSpatialFilterWithBoundingBox,
createSpatialFilterWithGeometry,
getBoundingBoxGeometry,
roundCoordinates,
} from '../../../../elasticsearch_geo_utils';
import { DrawTooltip } from './draw_tooltip';
const mbDrawModes = MapboxDraw.modes;
mbDrawModes.draw_rectangle = DrawRectangle;
export class DrawControl extends React.Component {
constructor() {
super();
this._mbDrawControl = new MapboxDraw({
displayControlsDefault: false,
modes: mbDrawModes,
});
this._mbDrawControlAdded = false;
}
componentDidUpdate() {
this._syncDrawControl();
}