Skip to content

Instantly share code, notes, and snippets.

View austinbirch's full-sized avatar

Austin Birch austinbirch

View GitHub Profile
austinbirch / RadiusMode.js
Created September 14, 2020 09:14 — forked from chriswhong/RadiusMode.js
RadiusMode, a custom mode for mapbox-gl-draw for drawing a radius
// custom mapbopx-gl-draw mode that modifies draw_line_string
// shows a center point, radius line, and circle polygon while drawing
// forces draw.create on creation of second vertex
import MapboxDraw from 'mapbox-gl-draw';
import numeral from 'numeral';
import lineDistance from 'npm:@turf/line-distance';
const RadiusMode = MapboxDraw.modes.draw_line_string;