🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

@ookla/mapbox-gl-draw-rectangle

Package Overview
Dependencies
Maintainers
63
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ookla/mapbox-gl-draw-rectangle

A custom mode for MapboxGL Draw to draw rectangles that adds the functionality of keeping the rectangle's shape when adjusting a corner of the drawn rectangle

latest
Source
npmnpm
Version
1.2.2
Version published
Weekly downloads
405
7.71%
Maintainers
63
Weekly downloads
 
Created
Source

Mapbox GL Draw Rectangle Mode

A custom mode for MapboxGL Draw to draw rectangles that adds the functionality of keeping the rectangle's shape when adjusting a corner of the drawn rectangles. This mode is compatible with @mapbox/mapbox-gl-draw@1.4.0 and above. Original inspiration comes from this package, which hasn't been mantained for the last 4 years: https://github.com/thegisdev/mapbox-gl-draw-rectangle-mode

Usage

import DrawRectangle from 'mapbox-gl-draw-rectangle-mode';

const modes = MapboxDraw.modes;
modes.draw_rectangle = DrawRectangle;

const draw = new MapboxDraw({
  modes: modes
});

draw.changeMode('draw_rectangle');

Once a rectangle is created, 1 event is fired:

  • draw.create with the created rectangle

Build

yarn build will do it.

License

MIT

Keywords

mapbox-gl

FAQs

Package last updated on 18 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts