@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
132 lines • 4.99 kB
TypeScript
import { EventEmitter, SimpleChanges } from '@angular/core';
import { CountdownIntervalComponent } from '@c8y/ngx-components';
import { ClusterMapComponent } from './cluster-map.component';
import { ClusterMapConfig, MapStatusButtonsConfig, PositionManagedObject } from './map.model';
import * as i0 from "@angular/core";
/**
* Component to display controls and status information for a map rendered on an IoT Dashboard.
* Provides UI for centering, fitting bounds, toggling real-time updates, auto-refresh, and following assets.
*/
export declare class MapStatusComponent {
/**
* Map configuration object, including center, refresh interval, and other map options.
*/
config: ClusterMapConfig;
/**
* List of managed objects with position information to be displayed on the map.
*/
assets: PositionManagedObject[];
/**
* Emits when the map configuration changes (e.g., toggling real-time, follow, etc.).
*/
configChange: EventEmitter<ClusterMapConfig>;
/**
* Emits when the user unfollows an asset on the map.
*/
onUnfollow: EventEmitter<ClusterMapConfig>;
/**
* Emits when the user requests to fit all assets within the map bounds.
*/
fitAssetsToBounds: EventEmitter<void>;
/**
* Reference to the ClusterMapComponent instance rendered in the view.
*/
clusterMap: ClusterMapComponent;
/**
* Configuration for which map status buttons are shown/enabled.
* By default the "center" button is shown and realtime is disabled.
* See {@link MapStatusButtonsConfig} for available options.
*/
buttonsConfig: Partial<MapStatusButtonsConfig>;
/**
* @ignore
*/
countdownIntervalComp: CountdownIntervalComponent;
/**
* @ignore
*/
initConfig: ClusterMapConfig;
/**
* @ignore
*/
refreshPaused: boolean;
private destroy$;
/**
* @ignore
*/
ngOnInit(): void;
/**
* @ignore
*/
ngAfterViewInit(): void;
/**
* @ignore
*/
ngOnChanges(changes: SimpleChanges): void;
/**
* Centers the map on the configured center coordinates.
*/
center(): void;
/**
* Emits an event to fit all assets within the map bounds and disables the button until the next change.
*/
fitToBounds(): void;
/**
* Reloads the map data.
*/
reload(): void;
/**
* Cancels the map reload operation.
*/
cancelReload(): void;
/**
* Toggles real-time updates for the map.
*/
toggleRealtime(): void;
/**
* Toggles the auto-refresh state for the map, pausing or resuming the countdown.
* @param $event Mouse event to prevent default and stop propagation.
*/
toggleAutoRefresh($event: MouseEvent): void;
/**
* Disables following an asset on the map and emits the change.
*/
unfollow(): void;
/**
* Enables following an asset on the map and emits the change.
*/
follow(): void;
/**
* @ignore
*/
ngOnDestroy(): void;
/**
* Subscribes to map changes and updates button states based on map bounds and center.
*/
private checkIfMapIsAlreadyCentered;
/**
* Checks if Center button should be disabled according to provided bounds.
* Provided bounds contain coordinates of current map rectangle corners.
* Center button should be disabled if distance between center coordinates (from config) and center of current bounds
* is less than 1/4 of bounds dimensions.
* To achieve it we just need to check if center coordinates (from config) are contained in the boundaries of
* current bounds shrunk by 25%.
* @param bounds Current map view boundaries.
* @returns True if distance between config center and current boundaries center is bigger than 1/4 of boundaries dimensions
*/
private shouldDisableCenterButton;
/**
* Checks if Fit to Bounds button should be disabled based on whether all assets are within the current bounds.
* @param bounds Current map view boundaries.
* @returns True if all assets are already within bounds, false otherwise.
*/
private shouldDisableFitToBoundsButton;
/**
* Returns the default configuration for map status buttons.
* @returns Default MapStatusButtonsConfig object.
*/
private defaultButtonsConfig;
static ɵfac: i0.ɵɵFactoryDeclaration<MapStatusComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MapStatusComponent, "c8y-map-status", never, { "config": { "alias": "config"; "required": false; }; "assets": { "alias": "assets"; "required": false; }; "clusterMap": { "alias": "clusterMap"; "required": false; }; "buttonsConfig": { "alias": "buttonsConfig"; "required": false; }; }, { "configChange": "configChange"; "onUnfollow": "onUnfollow"; "fitAssetsToBounds": "fitAssetsToBounds"; }, never, never, true, never>;
}
//# sourceMappingURL=map-status.component.d.ts.map