JSPM

mapboxgl-draw-circle-drag

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q60296F
  • License ISC

mapbox-gl-draw plugin for drawing a circle using mouse drag method

Package Exports

  • mapboxgl-draw-circle-drag

Readme

mapbox-gl-draw-circle-drag

Adds support for drawing and editing a circle drag feature using mapbox-gl-draw library. Lib based on https://github.com/iamanvesh/mapbox-gl-draw-circle/ , updated and compiled using both ESM, CommonJS modules, with typings.

Demo

Drag Circle Mode Demo

Usage

Installation

npm install mapboxgl-draw-circle-drag
import DragCircleMode, { withCircleSupport } from 'mapboxgl-draw-circle-drag';

// userProperties has to be enabled
const draw = new MapboxDraw({
  defaultMode: "drag_circle",
  userProperties: true,
  modes: {
    ...MapboxDraw.modes,
    drag_circle  : DragCircleMode,
    direct_select: withCircleSupport('direct_select'),
    simple_select: withCircleSupport('simple_select'),
  }
});

// Add this draw object to the map when map loads
map.addControl(draw);

It fires the same events as the mapbox-gl-draw library. For more information follow this link.