@2gis/mapgl-terra-draw
Version:
TerraDraw adapter for MapGL JS API
21 lines (20 loc) • 777 B
TypeScript
import './ui.css';
import 'vanilla-colorful';
import { TerraDraw } from 'terra-draw';
import type * as mapgl from '@2gis/mapgl/types';
import { Style } from './styles';
export type UiControlType = 'select' | 'point' | 'linestring' | 'polygon' | 'freehand' | 'circle' | 'rectangle' | 'angled-rectangle' | 'sector' | 'sensor' | 'download' | 'clear' | 'color' | 'stroke-width' | 'point-cap';
export interface MapDrawingOptions {
map: mapgl.Map;
mapgl: typeof mapgl;
container?: HTMLElement;
controls?: UiControlType[];
style?: Style;
}
/**
* Creates and initializes TerraDraw with UI controls
*/
export declare function createTerraDrawWithUI({ map, mapgl, container, controls, style, }: MapDrawingOptions): {
draw: TerraDraw;
cleanup: () => void;
};