UNPKG

maplibre-gl-js-amplify

Version:

MapLibre Plugin to Support Amplify Geo Integration

61 lines (60 loc) 2.59 kB
import { Map } from 'maplibre-gl'; import { DrawGeofencesOutput } from '../drawGeofences'; import { Geofence } from '../types'; import { AmplifyMapDraw } from './AmplifyMapDraw'; export interface AmplifyGeofenceControlOptions { geofenceCollectionId?: string; } export declare class AmplifyGeofenceControl { options: AmplifyGeofenceControlOptions; _geofenceCollectionId: string; _map: Map; _amplifyDraw: AmplifyMapDraw; _loadedGeofences?: Record<string, Geofence>; _displayedGeofences?: Geofence[]; _drawGeofencesOutput?: DrawGeofencesOutput; _highlightedGeofenceOutput?: DrawGeofencesOutput; _editingGeofenceId?: string; _listGeofencesNextToken?: string; _ui: any; _container?: HTMLElement; _geofenceCircleButton?: HTMLElement; _geofenceCreateInput?: HTMLElement; _addGeofenceContainer?: HTMLElement; constructor(options?: AmplifyGeofenceControlOptions); /********************************************************************** Public Methods for AmplifyGeofenceControl **********************************************************************/ getDefaultPosition(): string; onRemove(): void; reorderMapLibreClassNames(): void; onAdd(map: Map): HTMLElement; createGeofence(geofenceId?: string): Promise<string | null>; saveGeofence(geofenceId?: string): Promise<string | null>; loadInitialGeofences(): Promise<void>; loadMoreGeofences(): Promise<void>; editGeofence(geofenceId: string): void; deleteGeofence(geofenceId: string): Promise<string>; deleteSelectedGeofences(): void; /********************************************************************** Private methods for CRUD Geofences **********************************************************************/ _loadGeofence(geofence: Geofence): void; displayGeofence(geofenceId: string): void; displayAllGeofences(): void; fitGeofence(geofenceId: string): void; fitAllGeofences(): void; hideGeofence(geofenceId: string): void; hideAllGeofences(): void; _updateDisplayedGeofences(): void; displayHighlightedGeofence(geofenceId: string): void; hideHighlightedGeofence(): void; /********************************************************************** Methods for controlling amplify mapbox draw **********************************************************************/ changeMode(mode: string): void; resetGeofence(): void; setEditingModeEnabled(enabled: boolean): void; updateInputRadius(event: Event): void; addEditableGeofence(): void; }