How to use the @mapbox/mapbox-gl-draw/dist/mapbox-gl-draw-unminified.modes function in @mapbox/mapbox-gl-draw

To help you get started, we’ve selected a few @mapbox/mapbox-gl-draw examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / x-pack / plugins / maps / public / components / map / mb / view.js View on Github external
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) {
github elastic / kibana / x-pack / legacy / plugins / maps / public / connected_components / map / mb / draw_control / draw_control.js View on Github external
*/

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();
  }