ty-element 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/components/animate-container/index.d.ts +9 -0
- package/dist/components/animate-container/type.d.ts +67 -0
- package/dist/components/button/count/index.d.ts +3 -0
- package/dist/components/button/count/type.d.ts +16 -0
- package/dist/components/button/glow/index.d.ts +9 -0
- package/dist/components/button/glow/type.d.ts +21 -0
- package/dist/components/button/ripple/index.d.ts +9 -0
- package/dist/components/button/ripple/type.d.ts +30 -0
- package/dist/components/button/streamer/index.d.ts +3 -0
- package/dist/components/button/streamer/type.d.ts +11 -0
- package/dist/components/carousel/index.d.ts +10 -0
- package/dist/components/carousel/type.d.ts +18 -0
- package/dist/components/globe/entity-collection.d.ts +22 -0
- package/dist/components/globe/entity.d.ts +12 -0
- package/dist/components/globe/globe.d.ts +106 -0
- package/dist/components/globe/index.d.ts +3 -0
- package/dist/components/globe/sat-util.d.ts +26 -0
- package/dist/components/globe/satellite.d.ts +107 -0
- package/dist/components/globe/type.d.ts +71 -0
- package/dist/components/globe/wide-line/geometry.d.ts +22 -0
- package/dist/components/globe/wide-line/index.d.ts +7 -0
- package/dist/components/globe/wide-line/material.d.ts +22 -0
- package/dist/components/globe/wide-line/type.d.ts +10 -0
- package/dist/components/loading/progress/index.d.ts +8 -0
- package/dist/components/loading/progress/type.d.ts +80 -0
- package/dist/components/loading/tick/index.d.ts +8 -0
- package/dist/components/loading/tick/type.d.ts +36 -0
- package/dist/components/loading/water-progress/index.d.ts +8 -0
- package/dist/components/loading/water-progress/type.d.ts +31 -0
- package/dist/components/map/compare-map/index.d.ts +38 -0
- package/dist/components/map/compare-map/type.d.ts +52 -0
- package/dist/components/map/data-selector-map/index.d.ts +30 -0
- package/dist/components/map/data-selector-map/type.d.ts +99 -0
- package/dist/components/map/gis-map/index.d.ts +9 -0
- package/dist/components/map/gis-map/type.d.ts +132 -0
- package/dist/components/map/gis-maplibre/crepuscule/index.d.ts +49 -0
- package/dist/components/map/gis-maplibre/custom-layers/atmosphere-layer/index.d.ts +5 -0
- package/dist/components/map/gis-maplibre/custom-layers/atmosphere-layer/type.d.ts +20 -0
- package/dist/components/map/gis-maplibre/custom-layers/index.d.ts +40 -0
- package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/clock.d.ts +17 -0
- package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/index.d.ts +135 -0
- package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/source.d.ts +65 -0
- package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/type.d.ts +75 -0
- package/dist/components/map/gis-maplibre/custom-layers/star-layer/index.d.ts +6 -0
- package/dist/components/map/gis-maplibre/custom-layers/star-layer/type.d.ts +14 -0
- package/dist/components/map/gis-maplibre/custom-layers/sync-camera.d.ts +2 -0
- package/dist/components/map/gis-maplibre/custom-layers/type.d.ts +7 -0
- package/dist/components/map/gis-maplibre/index.d.ts +8 -0
- package/dist/components/map/gis-maplibre/type.d.ts +236 -0
- package/dist/components/map/gis-marker/index.d.ts +12 -0
- package/dist/components/map/gis-marker/type.d.ts +36 -0
- package/dist/components/map/multi-map/index.d.ts +8 -0
- package/dist/components/map/multi-map/syncMaps.d.ts +3 -0
- package/dist/components/map/multi-map/type.d.ts +2 -0
- package/dist/components/map/stac-data-map/index.d.ts +46 -0
- package/dist/components/map/stac-data-map/type.d.ts +78 -0
- package/dist/components/radar/index.d.ts +3 -0
- package/dist/components/radar/radar-instance.d.ts +34 -0
- package/dist/components/radar/type.d.ts +58 -0
- package/dist/components/ripple-container/index.d.ts +8 -0
- package/dist/components/ripple-container/type.d.ts +23 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/type.d.ts +114 -0
- package/dist/components/third-part/delete-button/index.d.ts +8 -0
- package/dist/components/third-part/delete-button/type.d.ts +28 -0
- package/dist/components/third-part/dragger-upload/index.d.ts +8 -0
- package/dist/components/third-part/dragger-upload/type.d.ts +8 -0
- package/dist/components/third-part/key-value/index.d.ts +8 -0
- package/dist/components/third-part/key-value/type.d.ts +47 -0
- package/dist/components/third-part/slider-input/index.d.ts +8 -0
- package/dist/components/third-part/slider-input/type.d.ts +40 -0
- package/dist/components/timeline/index.d.ts +8 -0
- package/dist/components/timeline/type.d.ts +105 -0
- package/dist/constants/index.d.ts +39 -0
- package/dist/draco/README.md +32 -0
- package/dist/draco/draco_decoder.js +34 -0
- package/dist/draco/draco_decoder.wasm +0 -0
- package/dist/draco/draco_encoder.js +33 -0
- package/dist/draco/draco_wasm_wrapper.js +117 -0
- package/dist/draco/gltf/draco_decoder.js +33 -0
- package/dist/draco/gltf/draco_decoder.wasm +0 -0
- package/dist/draco/gltf/draco_encoder.js +33 -0
- package/dist/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/dist/earth.jpg +0 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.js +33146 -0
- package/dist/shaders/program/index.d.ts +30 -0
- package/dist/shaders/shader.d.ts +16 -0
- package/dist/style.css +7 -0
- package/dist/types/geometry.d.ts +39 -0
- package/dist/types/stac.d.ts +69 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/utils/css/index.d.ts +8 -0
- package/dist/utils/io/index.d.ts +4 -0
- package/dist/utils/object/index.d.ts +6 -0
- package/dist/utils/random/index.d.ts +13 -0
- package/dist/utils/sat/index.d.ts +11 -0
- package/dist/utils/sat/type.d.ts +22 -0
- package/dist/utils/tle/index.d.ts +49 -0
- package/dist/utils/tle/type.d.ts +36 -0
- package/dist/utils/unit/index.d.ts +6 -0
- package/package.json +105 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ShaderMaterialParameters, Vector2 } from 'three';
|
|
2
|
+
export type WideLineMaterialConstructorOptions = {
|
|
3
|
+
resolution?: Vector2;
|
|
4
|
+
lineColor?: string;
|
|
5
|
+
lineWidth?: number;
|
|
6
|
+
lineOpacity?: number;
|
|
7
|
+
animated?: boolean;
|
|
8
|
+
sizeAttenuation?: boolean;
|
|
9
|
+
animateSpeed?: number;
|
|
10
|
+
} & ShaderMaterialParameters;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const ANIMATE_DURATION = 8;
|
|
3
|
+
export type ActiveOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* @description 进度条条带颜色默认#68e534
|
|
6
|
+
*/
|
|
7
|
+
color?: CSSProperties["color"];
|
|
8
|
+
/**
|
|
9
|
+
* @description 条带前进速度默认值1
|
|
10
|
+
*/
|
|
11
|
+
speed?: number;
|
|
12
|
+
/**
|
|
13
|
+
* @description 条带宽度默认值10px
|
|
14
|
+
*/
|
|
15
|
+
width?: number;
|
|
16
|
+
/**
|
|
17
|
+
* @description 条带旋转角度默认145deg
|
|
18
|
+
*/
|
|
19
|
+
angle?: number;
|
|
20
|
+
};
|
|
21
|
+
export type TipOptions = {
|
|
22
|
+
/**
|
|
23
|
+
* @description 进度条提示信息位置,默认center
|
|
24
|
+
*/
|
|
25
|
+
anchor?: "center" | "left" | "right";
|
|
26
|
+
/**
|
|
27
|
+
* @description 进度条提示信息颜色,默认#000
|
|
28
|
+
*/
|
|
29
|
+
color?: CSSProperties["color"];
|
|
30
|
+
/**
|
|
31
|
+
* @description 进度条提示信息字体大小,默认16px
|
|
32
|
+
*/
|
|
33
|
+
size?: CSSProperties["fontSize"];
|
|
34
|
+
/**
|
|
35
|
+
* @description 进度条提示信息类名
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
};
|
|
39
|
+
export type ProgressProps = {
|
|
40
|
+
/**
|
|
41
|
+
* @description 根元素类名
|
|
42
|
+
*/
|
|
43
|
+
rootClassName?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @description 进度条轮廓弧度
|
|
46
|
+
*/
|
|
47
|
+
borderRadius?: CSSProperties["borderRadius"];
|
|
48
|
+
/**
|
|
49
|
+
* @description 进度百分比0-100
|
|
50
|
+
*/
|
|
51
|
+
percentage: number;
|
|
52
|
+
/**
|
|
53
|
+
* @description 进度条容器背景色
|
|
54
|
+
*/
|
|
55
|
+
bgContainer?: CSSProperties["background"];
|
|
56
|
+
/**
|
|
57
|
+
* @description 进度条背景色
|
|
58
|
+
*/
|
|
59
|
+
bgProgress?: CSSProperties["background"];
|
|
60
|
+
/**
|
|
61
|
+
* @description 进度条容器宽度
|
|
62
|
+
*/
|
|
63
|
+
width?: string | number;
|
|
64
|
+
/**
|
|
65
|
+
* @description 进度条容器高度
|
|
66
|
+
*/
|
|
67
|
+
height?: string | number;
|
|
68
|
+
/**
|
|
69
|
+
* @description 进度条动画激活状态更多配置信息看ActiveOptions
|
|
70
|
+
*/
|
|
71
|
+
active?: ActiveOptions | boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @description 进度条提示信息,更多配置信息看TipOptions
|
|
74
|
+
*/
|
|
75
|
+
tip?: boolean | TipOptions;
|
|
76
|
+
/**
|
|
77
|
+
* @description 进度条完成回调
|
|
78
|
+
*/
|
|
79
|
+
onProgressComplete?: () => void;
|
|
80
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AnimationEventHandler, CSSProperties } from 'react';
|
|
2
|
+
export declare const COMPLETE_SIZE = 120;
|
|
3
|
+
export type TickProps = {
|
|
4
|
+
/**
|
|
5
|
+
* @description 根节点的类名
|
|
6
|
+
*/
|
|
7
|
+
rootClassName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description 尺寸大小
|
|
10
|
+
*/
|
|
11
|
+
size?: number;
|
|
12
|
+
/**
|
|
13
|
+
* @description 圆圈颜色
|
|
14
|
+
*/
|
|
15
|
+
circleColor?: CSSProperties["color"];
|
|
16
|
+
/**
|
|
17
|
+
* @description 圆圈线条宽度
|
|
18
|
+
*/
|
|
19
|
+
circleStrokeWidth?: number;
|
|
20
|
+
/**
|
|
21
|
+
* @description 对勾颜色
|
|
22
|
+
*/
|
|
23
|
+
tickColor?: CSSProperties["color"];
|
|
24
|
+
/**
|
|
25
|
+
* @description 对勾线条宽度
|
|
26
|
+
*/
|
|
27
|
+
tickStrokeWidth?: number;
|
|
28
|
+
/**
|
|
29
|
+
* @description 是否有动画
|
|
30
|
+
*/
|
|
31
|
+
hasAnimate?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description 动画完成事件
|
|
34
|
+
*/
|
|
35
|
+
onAnimateEnd?: AnimationEventHandler<SVGElement>;
|
|
36
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export type WaterProgressProps = {
|
|
3
|
+
/**
|
|
4
|
+
* @description 根元素类名
|
|
5
|
+
*/
|
|
6
|
+
rootClassName?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @description 进度百分比0-100
|
|
9
|
+
*/
|
|
10
|
+
percentage: number;
|
|
11
|
+
/**
|
|
12
|
+
* @description 进度条容器宽度与高度
|
|
13
|
+
*/
|
|
14
|
+
size?: CSSProperties["width"];
|
|
15
|
+
/**
|
|
16
|
+
* @description 进度条容器背景颜色
|
|
17
|
+
*/
|
|
18
|
+
bgContainer?: CSSProperties["background"];
|
|
19
|
+
/**
|
|
20
|
+
* @description 水体背景颜色
|
|
21
|
+
*/
|
|
22
|
+
bgWater?: CSSProperties["background"];
|
|
23
|
+
/**
|
|
24
|
+
* @description 进度条提示信息类名
|
|
25
|
+
*/
|
|
26
|
+
textClassName?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @description 进度条完成回调
|
|
29
|
+
*/
|
|
30
|
+
onProgressComplete?: () => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CompareMapRef } from './type';
|
|
2
|
+
import { GISMaplibreRef } from '../gis-maplibre/type';
|
|
3
|
+
/**
|
|
4
|
+
* @description 对比地图
|
|
5
|
+
* @author tiancheng.xia
|
|
6
|
+
* @since 2025-02-10
|
|
7
|
+
*/
|
|
8
|
+
declare const CompareMap: import('react').ForwardRefExoticComponent<{
|
|
9
|
+
leftMapOptions?: import('./type').CompareMapOptions;
|
|
10
|
+
rightMapOptions?: import('./type').CompareMapOptions;
|
|
11
|
+
slider?: import('react').ReactNode;
|
|
12
|
+
onMapsLoad?: (maps: GISMaplibreRef[]) => void;
|
|
13
|
+
initPosition?: number;
|
|
14
|
+
sliderVisible?: boolean;
|
|
15
|
+
defaultSliderColor?: import('react').CSSProperties["background"];
|
|
16
|
+
} & {
|
|
17
|
+
children?: string | import('react').ReactNode;
|
|
18
|
+
loadingClassName?: string;
|
|
19
|
+
rootClassName?: string;
|
|
20
|
+
width?: import('react').CSSProperties["width"];
|
|
21
|
+
height?: import('react').CSSProperties["height"];
|
|
22
|
+
bg?: import('react').CSSProperties["background"];
|
|
23
|
+
flex?: boolean;
|
|
24
|
+
justify?: import('react').CSSProperties["justifyContent"];
|
|
25
|
+
align?: import('react').CSSProperties["alignItems"];
|
|
26
|
+
direction?: "v" | "h";
|
|
27
|
+
gap?: import('react').CSSProperties["gap"];
|
|
28
|
+
loadingOptions?: {
|
|
29
|
+
element?: import('react').ReactNode;
|
|
30
|
+
spin?: boolean;
|
|
31
|
+
text?: string | import('react').ReactNode;
|
|
32
|
+
size?: number;
|
|
33
|
+
color?: string;
|
|
34
|
+
};
|
|
35
|
+
animateName?: import('../../..').AnimateName;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
} & Omit<import('react').HTMLAttributes<HTMLDivElement>, "children" | "className"> & import('react').RefAttributes<CompareMapRef>>;
|
|
38
|
+
export default CompareMap;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AnimateContainerProps } from '../../animate-container/type';
|
|
2
|
+
import { GISMaplibreProps, GISMaplibreRef } from '../gis-maplibre/type';
|
|
3
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
4
|
+
export type CompareMapOptions = Omit<GISMaplibreProps, "ref" | "onLoad">;
|
|
5
|
+
export type CompareMapProps = {
|
|
6
|
+
/**
|
|
7
|
+
* @description 左边地图props,与GISMaplibreProps一致,除去了ref和onLoad
|
|
8
|
+
*/
|
|
9
|
+
leftMapOptions?: CompareMapOptions;
|
|
10
|
+
/**
|
|
11
|
+
* @description 右边地图props,与GISMaplibreProps一致,除去了ref和onLoad
|
|
12
|
+
*/
|
|
13
|
+
rightMapOptions?: CompareMapOptions;
|
|
14
|
+
/**
|
|
15
|
+
* @description 自定义滑块组件,需要设置样式position为absolute,以及transform的translateX(-50%)否则无法居中
|
|
16
|
+
*/
|
|
17
|
+
slider?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* @description 所有地图加载完成事件,maps返回顺序从左到右
|
|
20
|
+
*/
|
|
21
|
+
onMapsLoad?: (maps: GISMaplibreRef[]) => void;
|
|
22
|
+
/**
|
|
23
|
+
* @description 滑块初始化位置,0 - 100
|
|
24
|
+
*/
|
|
25
|
+
initPosition?: number;
|
|
26
|
+
/**
|
|
27
|
+
* @description 滑块是否可见
|
|
28
|
+
*/
|
|
29
|
+
sliderVisible?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @description 滑块默认颜色
|
|
32
|
+
*/
|
|
33
|
+
defaultSliderColor?: CSSProperties["background"];
|
|
34
|
+
} & AnimateContainerProps;
|
|
35
|
+
export type CompareMapRef = {
|
|
36
|
+
/**
|
|
37
|
+
* @description 获取所有地图实例,顺序从左到右
|
|
38
|
+
*/
|
|
39
|
+
getMaps: () => GISMaplibreRef[];
|
|
40
|
+
/**
|
|
41
|
+
* @description 获取滑块DOM
|
|
42
|
+
*/
|
|
43
|
+
getSlider: () => HTMLDivElement | null;
|
|
44
|
+
/**
|
|
45
|
+
* @description 设置滑块位置,0 - 100
|
|
46
|
+
*/
|
|
47
|
+
setSliderPosition: (position: number) => void;
|
|
48
|
+
/**
|
|
49
|
+
* @description 获取滑块位置,0 - 100
|
|
50
|
+
*/
|
|
51
|
+
getSliderPosition: () => number;
|
|
52
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DataSelectorMapChangeEvent, DataSelectorMapRef } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* @description 数据选择地图组件
|
|
4
|
+
* @author tiancheng.xia
|
|
5
|
+
* @since 2025-01-03
|
|
6
|
+
*/
|
|
7
|
+
declare const DataSelectorMap: import('react').ForwardRefExoticComponent<{
|
|
8
|
+
precision?: number;
|
|
9
|
+
style?: {
|
|
10
|
+
draw?: {
|
|
11
|
+
color?: string;
|
|
12
|
+
opacity?: number;
|
|
13
|
+
outlineWidth?: number;
|
|
14
|
+
pointColor?: string;
|
|
15
|
+
pointRadius?: number;
|
|
16
|
+
};
|
|
17
|
+
measure?: {
|
|
18
|
+
color?: string;
|
|
19
|
+
opacity?: number;
|
|
20
|
+
outlineWidth?: number;
|
|
21
|
+
pointColor?: string;
|
|
22
|
+
pointRadius?: number;
|
|
23
|
+
textClassName?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
scalerDomSize?: number;
|
|
27
|
+
onChange?: (e: DataSelectorMapChangeEvent) => void;
|
|
28
|
+
onScaleChange?: (dis: number) => void;
|
|
29
|
+
} & import('../gis-maplibre/type').GISMaplibreProps & import('react').RefAttributes<DataSelectorMapRef>>;
|
|
30
|
+
export default DataSelectorMap;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Feature, FeatureCollection, MultiPolygon, Polygon } from '../../../types/geometry';
|
|
2
|
+
import { GISMaplibreProps, GISMaplibreRef } from '../gis-maplibre/type';
|
|
3
|
+
import { GetValue } from '../../../types/utils';
|
|
4
|
+
export type DataSelectorMapChangeEvent = {
|
|
5
|
+
type: DrawMode;
|
|
6
|
+
data: Feature<Polygon | MultiPolygon> | FeatureCollection<Polygon | MultiPolygon>;
|
|
7
|
+
};
|
|
8
|
+
export type DataSelectorMapProps = {
|
|
9
|
+
/**
|
|
10
|
+
* @description 输出的精度位数
|
|
11
|
+
* @default 2
|
|
12
|
+
*/
|
|
13
|
+
precision?: number;
|
|
14
|
+
/**
|
|
15
|
+
* @description 测量、绘制的样式配置,默认值见右侧
|
|
16
|
+
*/
|
|
17
|
+
style?: {
|
|
18
|
+
draw?: {
|
|
19
|
+
color?: string;
|
|
20
|
+
opacity?: number;
|
|
21
|
+
outlineWidth?: number;
|
|
22
|
+
pointColor?: string;
|
|
23
|
+
pointRadius?: number;
|
|
24
|
+
};
|
|
25
|
+
measure?: {
|
|
26
|
+
color?: string;
|
|
27
|
+
opacity?: number;
|
|
28
|
+
outlineWidth?: number;
|
|
29
|
+
pointColor?: string;
|
|
30
|
+
pointRadius?: number;
|
|
31
|
+
textClassName?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* @description 比例尺的默认宽度,单位是像素
|
|
36
|
+
* @default 100
|
|
37
|
+
*/
|
|
38
|
+
scalerDomSize?: number;
|
|
39
|
+
/**
|
|
40
|
+
* @description 绘制图形改变事件
|
|
41
|
+
* @param e
|
|
42
|
+
*/
|
|
43
|
+
onChange?: (e: DataSelectorMapChangeEvent) => void;
|
|
44
|
+
/**
|
|
45
|
+
* @description 地图比例尺改变事件
|
|
46
|
+
* @param dis 每“scalerDomSize”像素代表地图上多少距离
|
|
47
|
+
*/
|
|
48
|
+
onScaleChange?: (dis: number) => void;
|
|
49
|
+
} & GISMaplibreProps;
|
|
50
|
+
export type DataSelectorMapRef = {
|
|
51
|
+
/**
|
|
52
|
+
* @description 开始绘制
|
|
53
|
+
*/
|
|
54
|
+
draw: (mode: Exclude<DrawMode, "custom">) => void;
|
|
55
|
+
/**
|
|
56
|
+
* @description 开始测量
|
|
57
|
+
*/
|
|
58
|
+
measure: (mode: MeasureMode) => void;
|
|
59
|
+
/**
|
|
60
|
+
* @description 设置框选区域
|
|
61
|
+
*/
|
|
62
|
+
setDrawData: (data: FeatureCollection<Polygon | MultiPolygon>) => void;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @description 获取框选区域
|
|
66
|
+
*/
|
|
67
|
+
getDrawData: () => Feature<Polygon | MultiPolygon> | FeatureCollection<Polygon | MultiPolygon>;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @description 获取当前绘制模式
|
|
71
|
+
*/
|
|
72
|
+
getDrawMode: () => DrawMode;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @description 获取当前测量模式
|
|
76
|
+
*/
|
|
77
|
+
getMeasureMode: () => MeasureMode;
|
|
78
|
+
} & GISMaplibreRef;
|
|
79
|
+
export declare const DrawMode: {
|
|
80
|
+
readonly POLYGON: "polygon";
|
|
81
|
+
readonly RECTANGLE: "rectangle";
|
|
82
|
+
readonly CUSTOM: "custom";
|
|
83
|
+
readonly STOP: "stop";
|
|
84
|
+
};
|
|
85
|
+
export type DrawMode = GetValue<typeof DrawMode>;
|
|
86
|
+
export declare const MeasureMode: {
|
|
87
|
+
readonly LINE: "line";
|
|
88
|
+
readonly POLYGON: "polygon";
|
|
89
|
+
readonly STOP: "stop";
|
|
90
|
+
};
|
|
91
|
+
export type MeasureMode = GetValue<typeof MeasureMode>;
|
|
92
|
+
export declare const DRAW_SOURCE_ID = "sv-cps-draw-data";
|
|
93
|
+
export declare const DRAW_LAYER_FILL_ID = "sv-cps-draw-fill";
|
|
94
|
+
export declare const DRAW_LAYER_LINE_ID = "sv-cps-draw-line";
|
|
95
|
+
export declare const DRAW_LAYER_CIRCLE_ID = "sv-cps-draw-circle";
|
|
96
|
+
export declare const MEASURE_SOURCE_ID = "sv-cps-measure-data";
|
|
97
|
+
export declare const MEASURE_LAYER_FILL_ID = "sv-cps-measure-fill";
|
|
98
|
+
export declare const MEASURE_LAYER_LINE_ID = "sv-cps-measure-line";
|
|
99
|
+
export declare const MEASURE_LAYER_CIRCLE_ID = "sv-cps-measure-circle";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GISMapProps, GISMapRef } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* @description GIS map component
|
|
4
|
+
* @author tiancheng.xia
|
|
5
|
+
* @since 2025-01-02
|
|
6
|
+
* @deprecated cause no-oss license
|
|
7
|
+
*/
|
|
8
|
+
declare const GISMap: import('react').ForwardRefExoticComponent<GISMapProps & import('react').RefAttributes<GISMapRef>>;
|
|
9
|
+
export default GISMap;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Feature, FeatureCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from '../../../types/geometry';
|
|
2
|
+
import { default as mapboxgl } from 'mapbox-gl';
|
|
3
|
+
import { CSSProperties } from 'react';
|
|
4
|
+
import { AddCircleLayerOptions, AddPolygonLayerOptions, MapCursor } from '../gis-maplibre/type';
|
|
5
|
+
export type GISMapProps = {
|
|
6
|
+
/**
|
|
7
|
+
* @description 地图初始化配置
|
|
8
|
+
*/
|
|
9
|
+
mapOptions?: Omit<mapboxgl.MapboxOptions, "container">;
|
|
10
|
+
/**
|
|
11
|
+
* @description 地图加载完成回调
|
|
12
|
+
*/
|
|
13
|
+
onLoad?: (map: mapboxgl.Map) => void;
|
|
14
|
+
/**
|
|
15
|
+
* @description 容器的类名
|
|
16
|
+
*/
|
|
17
|
+
rootClassName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @description 容器的样式
|
|
20
|
+
*/
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
export type GISMapRef = {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @description 获取地图实例
|
|
27
|
+
*/
|
|
28
|
+
getMap: () => mapboxgl.Map | null;
|
|
29
|
+
/**
|
|
30
|
+
* @description 地图自适应
|
|
31
|
+
*/
|
|
32
|
+
fitBounds: (bounds: mapboxgl.LngLatBoundsLike, options?: mapboxgl.FitBoundsOptions) => void;
|
|
33
|
+
/**
|
|
34
|
+
* @description 设置地图视图
|
|
35
|
+
*/
|
|
36
|
+
setView: (options: mapboxgl.CameraOptions & mapboxgl.AnimationOptions) => void;
|
|
37
|
+
/**
|
|
38
|
+
* @description 移除地图数据源
|
|
39
|
+
*/
|
|
40
|
+
removeSource: (sourceId: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* @description 移除图层
|
|
43
|
+
*/
|
|
44
|
+
removeLayer: (layerId: string) => void;
|
|
45
|
+
/**
|
|
46
|
+
* @description 移除地图数据源和图层,前提是数据源与图层是一对一的关系
|
|
47
|
+
*/
|
|
48
|
+
removeSourceAndLayer: (id: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* @description 添加栅格图层
|
|
51
|
+
*/
|
|
52
|
+
addRasterLayer: (id: string, tileUrl: string, beforeId?: string) => void;
|
|
53
|
+
/**
|
|
54
|
+
* @description 添加图片图层
|
|
55
|
+
*/
|
|
56
|
+
addImageLayer: (id: string, imageUrl: string, coordinates: number[][], beforeId?: string) => void;
|
|
57
|
+
/**
|
|
58
|
+
* @description 添加 GeoJson面或者线图层
|
|
59
|
+
*/
|
|
60
|
+
addGeoJsonPolygonLayer: (id: string, geojson: FeatureCollection<Polygon | MultiPolygon> | FeatureCollection<LineString | MultiLineString>, options?: AddPolygonLayerOptions) => void;
|
|
61
|
+
/**
|
|
62
|
+
* @description 添加 GeoJson点图层
|
|
63
|
+
*/
|
|
64
|
+
addGeoJsonCircleLayer: (id: string, geojson: FeatureCollection<Point | MultiPoint>, options?: AddCircleLayerOptions) => void;
|
|
65
|
+
/**
|
|
66
|
+
* @description 设置 GeoJson数据
|
|
67
|
+
*/
|
|
68
|
+
setGeoJsonData: <T>(id: string, geojson: FeatureCollection<T>) => void;
|
|
69
|
+
/**
|
|
70
|
+
* @description 获取 GeoJson数据
|
|
71
|
+
*/
|
|
72
|
+
getGeoJsonData: <T>(id: string) => FeatureCollection<T> | Feature<T> | null;
|
|
73
|
+
/**
|
|
74
|
+
* @description 变化尺寸
|
|
75
|
+
*/
|
|
76
|
+
resize: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* @description 移除地图
|
|
79
|
+
*/
|
|
80
|
+
remove: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* @description 添加图层
|
|
83
|
+
*/
|
|
84
|
+
addLayer: (layer: mapboxgl.AnyLayer, beforeId?: string) => void;
|
|
85
|
+
/**
|
|
86
|
+
* @description 添加数据源
|
|
87
|
+
*/
|
|
88
|
+
addSource: (id: string, source: mapboxgl.AnySourceData) => void;
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* @description 设置底图
|
|
92
|
+
*/
|
|
93
|
+
setBaseLayer: (url: string) => void;
|
|
94
|
+
/**
|
|
95
|
+
* @description 设置图层可见性
|
|
96
|
+
*/
|
|
97
|
+
setLayerVisible: (id: string, visible: boolean) => void;
|
|
98
|
+
/**
|
|
99
|
+
* @description 设置地图上的鼠标状态
|
|
100
|
+
*/
|
|
101
|
+
setCursor: (cursor: MapCursor) => void;
|
|
102
|
+
/**
|
|
103
|
+
* @description 获取当前地图上的比例尺距离,单位是m
|
|
104
|
+
*/
|
|
105
|
+
getScale: (domSize: number) => number;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @description 获取当前地图是否加载完毕
|
|
109
|
+
*/
|
|
110
|
+
loaded: () => boolean;
|
|
111
|
+
/**
|
|
112
|
+
* @description 将当前的canvas转为blob流
|
|
113
|
+
*/
|
|
114
|
+
toBlob: HTMLCanvasElement["toBlob"];
|
|
115
|
+
/**
|
|
116
|
+
* @description 下载当前的canvas
|
|
117
|
+
*/
|
|
118
|
+
download: (format: "png" | "jpg", fileName?: string) => void;
|
|
119
|
+
/**
|
|
120
|
+
* @description 设置布局属性
|
|
121
|
+
*/
|
|
122
|
+
setLayoutProperty: (id: string, property: string, value: any) => void;
|
|
123
|
+
/**
|
|
124
|
+
* @description 设置样式属性
|
|
125
|
+
*/
|
|
126
|
+
setPaintProperty: (id: string, property: string, value: any) => void;
|
|
127
|
+
/**
|
|
128
|
+
* @description 为基础地图添加label,可以切换中英文,为空时候移除label
|
|
129
|
+
*/
|
|
130
|
+
setBaseLayerLabel: (language?: "en" | "cn") => void;
|
|
131
|
+
};
|
|
132
|
+
export declare const GISMAP_DISPLAY_NAME = "SV-CPS-GISMAP";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Map } from 'maplibre-gl';
|
|
2
|
+
export type Color = [number, number, number];
|
|
3
|
+
export type CrepusculeOptions = {
|
|
4
|
+
color?: Color;
|
|
5
|
+
opacity?: number;
|
|
6
|
+
date?: Date;
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type TransitionOptions = {
|
|
10
|
+
duration?: number;
|
|
11
|
+
delay?: number;
|
|
12
|
+
};
|
|
13
|
+
export declare class Crepuscule {
|
|
14
|
+
private map;
|
|
15
|
+
private color;
|
|
16
|
+
private opacity;
|
|
17
|
+
private date;
|
|
18
|
+
private unique;
|
|
19
|
+
private protocolNamespace;
|
|
20
|
+
private tileUriPattern;
|
|
21
|
+
private layerId;
|
|
22
|
+
private sourceId;
|
|
23
|
+
private debug;
|
|
24
|
+
private source;
|
|
25
|
+
private wasUnmounted;
|
|
26
|
+
constructor(map: Map, options?: CrepusculeOptions);
|
|
27
|
+
private generateTilePixelOnWorker;
|
|
28
|
+
private init;
|
|
29
|
+
setOpacity(o: number): void;
|
|
30
|
+
hide(): void;
|
|
31
|
+
show(): void;
|
|
32
|
+
setDate(date: Date): void;
|
|
33
|
+
update(): void;
|
|
34
|
+
unmount(): void;
|
|
35
|
+
private raiseIfUnmounted;
|
|
36
|
+
}
|
|
37
|
+
export declare class CrepusculeLive {
|
|
38
|
+
private opacity;
|
|
39
|
+
private crA;
|
|
40
|
+
private crB;
|
|
41
|
+
private usingA;
|
|
42
|
+
private intervalId;
|
|
43
|
+
private map;
|
|
44
|
+
constructor(map: Map, options?: CrepusculeOptions);
|
|
45
|
+
start(): void;
|
|
46
|
+
stop(): void;
|
|
47
|
+
_update(): void;
|
|
48
|
+
unmount(): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AtmosphereLayer } from './type';
|
|
2
|
+
export declare const ATMOSPHERE_LAYER_ID = "sv-cps-atmosphere-layer";
|
|
3
|
+
export declare const ATMOSPHERE_GLOW_LAYER_ID = "sv-cps-atmosphere-glow-layer";
|
|
4
|
+
declare const getAtmosphereLayer: () => AtmosphereLayer;
|
|
5
|
+
export default getAtmosphereLayer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as Program } from '../../../../../shaders/program';
|
|
2
|
+
import { CustomLayer } from '../type';
|
|
3
|
+
export type AtmosPhereRenderPrepares = {
|
|
4
|
+
aLocations: {
|
|
5
|
+
[k: string]: number;
|
|
6
|
+
};
|
|
7
|
+
programInstance: Program;
|
|
8
|
+
positionBuffer: WebGLBuffer;
|
|
9
|
+
positionIndexBuffer: WebGLBuffer;
|
|
10
|
+
uvBuffer: WebGLBuffer;
|
|
11
|
+
};
|
|
12
|
+
export type AtmosphereOptions = {
|
|
13
|
+
/** 环境光强度 */
|
|
14
|
+
intensity?: number;
|
|
15
|
+
/** 环境光起始颜色 */
|
|
16
|
+
startColor?: string;
|
|
17
|
+
/** 环境光终止颜色 */
|
|
18
|
+
endColor?: string;
|
|
19
|
+
};
|
|
20
|
+
export type AtmosphereLayer = CustomLayer<AtmosPhereRenderPrepares> & AtmosphereOptions;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CustomRenderMethodInput, Map } from 'maplibre-gl';
|
|
2
|
+
import { RenderLoop } from './type';
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
export type RenderingMode = "2d" | "3d";
|
|
5
|
+
/**
|
|
6
|
+
* @description 自定义图层
|
|
7
|
+
* @author tiancheng.xia
|
|
8
|
+
* @since 2025-04-15
|
|
9
|
+
*/
|
|
10
|
+
declare class CustomLayer {
|
|
11
|
+
id: string;
|
|
12
|
+
renderingMode: RenderingMode;
|
|
13
|
+
type: "custom";
|
|
14
|
+
camera: THREE.PerspectiveCamera;
|
|
15
|
+
scene: THREE.Scene;
|
|
16
|
+
renderer?: THREE.WebGLRenderer;
|
|
17
|
+
map?: Map;
|
|
18
|
+
gl?: WebGLRenderingContext | WebGL2RenderingContext;
|
|
19
|
+
args?: CustomRenderMethodInput;
|
|
20
|
+
static _earthRadius: number;
|
|
21
|
+
_renderLoop?: RenderLoop;
|
|
22
|
+
_raycaster: THREE.Raycaster;
|
|
23
|
+
_projByViewInv: THREE.Matrix4;
|
|
24
|
+
constructor(id: string, renderingMode?: RenderingMode);
|
|
25
|
+
get canvas(): HTMLCanvasElement | undefined;
|
|
26
|
+
get _2dLayerId(): string;
|
|
27
|
+
setRay(point: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
}): void;
|
|
31
|
+
getRay(): THREE.Raycaster;
|
|
32
|
+
repaint(): void;
|
|
33
|
+
setRenderLoop(callback: RenderLoop): void;
|
|
34
|
+
setVisible(visible: boolean): void;
|
|
35
|
+
_setRenderingMode(mode: RenderingMode): void;
|
|
36
|
+
onAdd(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
37
|
+
render(gl: WebGLRenderingContext | WebGL2RenderingContext, args: CustomRenderMethodInput): void;
|
|
38
|
+
onRemove(): void;
|
|
39
|
+
}
|
|
40
|
+
export default CustomLayer;
|