UNPKG

google-maps-drawing-tools

Version:
39 lines (38 loc) 882 B
/// <reference types="googlemaps" /> /** * Base class for all tools */ /** * Available tool ids to use for `manager.changeTool`. */ export declare enum ToolId { Marker = "marker", Circle = "circle", Polygon = "polygon", Line = "line", Rectangle = "rectangle", } /** * Object representing the shape in progress or completed. * * When the shape is completed, this object will have it's `feature` attribute * filled in. */ export interface Shape { id: string; toolType?: ToolId; feature?: google.maps.Data.Feature; } export interface ToolOptions { map: google.maps.Map; } export default abstract class Tool { map: google.maps.Map | null; id?: ToolId; shape?: Shape; private _feature?; constructor(options: ToolOptions); activate(): Shape; deactivate(): void; feature: google.maps.Data.Feature | undefined; }