@dp_unity/dpu-gis-viewer
Version:
DPU GIS Viewer version Beta
87 lines (85 loc) • 3.6 kB
TypeScript
import { Viewer, Cartesian3, BoundingSphere } from "cesium";
import { ToolTipArrowType } from "../interfaces/utils";
import { TileModel } from "src/class/tileModel";
export declare const colorIsolate: string;
export declare const colorDefaultByTask = "rgba(240,240,240,1)";
export declare const colorElementDefault = "rgba(255,255,255,1)";
export declare const createUUID: () => string;
export declare const rgbaToHex: (r: number, g: number, b: number, a: number) => string;
export declare const hexToCesiumColor: (hex: string, opacity?: number) => string;
export declare const rgbaToCesiumFormat: (r: number, g: number, b: number, a: number) => {
red: number;
green: number;
blue: number;
alpha: number;
};
export declare const colorIsolateCesium: {
red: number;
green: number;
blue: number;
alpha: number;
};
/**
* Chặn các ký tự không hợp lệ và chỉ cho phép nhập số nguyên
*/
export declare const restrictToIntegerInput: (event: KeyboardEvent) => void;
/**
* Chuẩn hóa mã màu HEX.
*/
export declare const normalizeHexColor: (hexColor: string) => string;
/**
* Chuẩn hóa mã màu HEX với Opacity.
*/
export declare const convertHexWithOpacity: (hex: string, opacity: number) => string;
/**
* Lấy mã màu từ localStorage hoặc trả về giá trị mặc định.
*/
export declare const getColorFromLocalStorage: (defaultColor?: string) => string;
export declare const watchElement: (element: HTMLElement | null, callback: (info: {
element: HTMLElement;
width: number;
height: number;
}) => void) => void;
export declare const watchElementBySelector: (selector: string, callback: (info: {
element: HTMLElement;
width: number;
height: number;
}) => void) => void;
export declare const handleWindowResizeByElement: (element: HTMLElement, callback?: (info: {
element: HTMLElement;
width: number;
height: number;
}) => void) => void;
export declare const handleWindowResizeBySelector: (elementId: string, callback?: (info: {
element: HTMLElement;
width: number;
height: number;
}) => void) => void;
export declare const flyToVietNam: (viewer: Viewer) => void;
export declare const saveCurrentView: (viewer: Viewer) => string;
export declare const restoreSavedView: (viewer: Viewer, obj: string, durationTime?: number) => void;
export declare const base64ToFile: (base64: string, filename: string) => File;
export declare const createBoundingSphereFromCartesianBounds: (min: Cartesian3, max: Cartesian3) => BoundingSphere;
export declare const createBoundingSphereFromLatLonBounds: (minCoord: [number, number, number], maxCoord: [number, number, number]) => BoundingSphere;
export declare const flyToBoundingBox: (viewer: Viewer, boundingBox: BoundingSphere, duration?: number) => void;
export declare const showToolTipByElement: (element: {
parentElement: HTMLElement;
childElement: HTMLElement;
attribute?: string;
toolTip?: string;
typeArrow?: ToolTipArrowType;
}) => void;
export declare const compareModelMatrix: (matrix1: {
[key: number]: number;
}, matrix2: {
[key: number]: number;
}) => boolean;
export declare const handleTreeModelTile: (tree: TileModel[]) => void;
export declare function findChildren(data: any[], parentId: string): any[];
export declare const hasAnyValidInput: (obj: any) => boolean;
export declare const findBoundingBoxFromTileModel: (children: TileModel[]) => {
min: Cartesian3;
max: Cartesian3;
} | undefined;
export type ExtColorMap = Record<string, string>;
export declare const BASE_COLORS: ExtColorMap;