@xingm/vmap-cesium-toolbar 0.0.2-alpha.16 → 0.0.2-alpha.17

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.
@@ -15,6 +15,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
15
15
  id: string;
16
16
  icon: string;
17
17
  title: string;
18
+ titleKey: string;
18
19
  color: string;
19
20
  borderColor: string;
20
21
  backgroundColor: string;
@@ -25,6 +26,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
25
26
  id: string;
26
27
  icon: string;
27
28
  title: string;
29
+ titleKey: string;
28
30
  color: string;
29
31
  backgroundColor: string;
30
32
  borderColor?: undefined;
@@ -36,6 +38,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
36
38
  icon: boolean;
37
39
  activeIcon: boolean;
38
40
  title: string;
41
+ titleKey: string;
39
42
  color: string;
40
43
  backgroundColor: string;
41
44
  borderColor?: undefined;
@@ -45,6 +48,7 @@ export declare const useToolBarConfig: (viewer: Viewer | undefined, message: Ref
45
48
  id: string;
46
49
  icon: string;
47
50
  title: string;
51
+ titleKey: string;
48
52
  color: string;
49
53
  borderColor: string;
50
54
  backgroundColor: string;
@@ -232,6 +232,7 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
232
232
  addLine: () => void;
233
233
  addArea: () => void;
234
234
  addCircle: () => void;
235
+ addCircle123: () => void;
235
236
  addRing: (i?: number) => Cesium.Entity | undefined;
236
237
  addPolygon: () => void;
237
238
  addRectangle: () => void;
@@ -0,0 +1,135 @@
1
+ declare const enUS: {
2
+ locale: string;
3
+ app: {
4
+ lang: {
5
+ zh: string;
6
+ en: string;
7
+ };
8
+ located: string;
9
+ init_success: string;
10
+ heatmap_empty: string;
11
+ heatmap_need_add: string;
12
+ heatmap_added: string;
13
+ heatmap_auto_on: string;
14
+ heatmap_auto_off: string;
15
+ heatmap_lod_coarse: string;
16
+ heatmap_lod_medium: string;
17
+ heatmap_lod_fine: string;
18
+ ring_test_added: string;
19
+ custom_alert: string;
20
+ custom_stats: string;
21
+ custom_visibility: string;
22
+ custom_alert_title: string;
23
+ custom_stats_title: string;
24
+ custom_visibility_title: string;
25
+ };
26
+ ui: {
27
+ draw: {
28
+ line: string;
29
+ area: string;
30
+ area_no_label: string;
31
+ circle: string;
32
+ circle_no_label: string;
33
+ polygon: string;
34
+ polygon_point_intercept: string;
35
+ polygon_finish_fallback: string;
36
+ polygon_no_label: string;
37
+ };
38
+ add: {
39
+ marker: string;
40
+ line: string;
41
+ area: string;
42
+ circle: string;
43
+ circle123: string;
44
+ polygon: string;
45
+ polyline: string;
46
+ icon: string;
47
+ svg: string;
48
+ marker_with_label: string;
49
+ label: string;
50
+ rectangle: string;
51
+ info_window: string;
52
+ ring: string;
53
+ ring_test: string;
54
+ heatmap: string;
55
+ };
56
+ test: {
57
+ set_highlight: string;
58
+ toggle_highlight: string;
59
+ };
60
+ heatmap: {
61
+ auto_on: string;
62
+ auto_off: string;
63
+ lod_coarse: string;
64
+ lod_medium: string;
65
+ lod_fine: string;
66
+ };
67
+ };
68
+ draw: {
69
+ start: {
70
+ line: string;
71
+ rectangle: string;
72
+ rectangle_no_label: string;
73
+ circle: string;
74
+ circle_no_label: string;
75
+ polygon: string;
76
+ polygon_no_label: string;
77
+ polygon_point_intercept: string;
78
+ polygon_finish_fallback: string;
79
+ };
80
+ done: {
81
+ line: string;
82
+ rectangle: string;
83
+ rectangle_no_label: string;
84
+ circle: string;
85
+ circle_no_label: string;
86
+ polygon: string;
87
+ polygon_no_label: string;
88
+ polygon_point_intercept_ok: string;
89
+ polygon_point_intercept_end: string;
90
+ polygon_finish_fallback_ok: string;
91
+ polygon_finish_fallback_blocked: string;
92
+ };
93
+ };
94
+ overlay: {
95
+ marker_mode: string;
96
+ marker_added: string;
97
+ marker_position: string;
98
+ sample_marker_label: string;
99
+ sample_marker_added: string;
100
+ icon_added: string;
101
+ icon_clicked: string;
102
+ svg_added: string;
103
+ svg_clicked: string;
104
+ polyline_added: string;
105
+ polyline_clicked: string;
106
+ line_added: string;
107
+ line_clicked: string;
108
+ area_added: string;
109
+ area_a_clicked: string;
110
+ area_b_clicked: string;
111
+ circle_added: string;
112
+ circle_a_clicked: string;
113
+ circle_b_clicked: string;
114
+ circle_c_clicked: string;
115
+ circle_d_clicked: string;
116
+ circle_e_clicked: string;
117
+ circle_alarm_clicked: string;
118
+ circle_detect_clicked: string;
119
+ rectangle_added: string;
120
+ rectangle_a_clicked: string;
121
+ rectangle_b_clicked: string;
122
+ rectangle_c_clicked: string;
123
+ rectangle_d_clicked: string;
124
+ rectangle_e_clicked: string;
125
+ highlight_need_rect_b: string;
126
+ highlight_need_rect_e: string;
127
+ info_window_added: string;
128
+ info_clicked: string;
129
+ info_window_title: string;
130
+ info_window_desc: string;
131
+ ring_added: string;
132
+ ring_clicked: string;
133
+ };
134
+ };
135
+ export default enUS;
@@ -0,0 +1,3 @@
1
+ import { I18nLike } from '../libs/i18n';
2
+ export declare const i18n: I18nLike;
3
+ export type { I18nLike };
@@ -0,0 +1,135 @@
1
+ declare const zhCN: {
2
+ locale: string;
3
+ app: {
4
+ lang: {
5
+ zh: string;
6
+ en: string;
7
+ };
8
+ located: string;
9
+ init_success: string;
10
+ heatmap_empty: string;
11
+ heatmap_need_add: string;
12
+ heatmap_added: string;
13
+ heatmap_auto_on: string;
14
+ heatmap_auto_off: string;
15
+ heatmap_lod_coarse: string;
16
+ heatmap_lod_medium: string;
17
+ heatmap_lod_fine: string;
18
+ ring_test_added: string;
19
+ custom_alert: string;
20
+ custom_stats: string;
21
+ custom_visibility: string;
22
+ custom_alert_title: string;
23
+ custom_stats_title: string;
24
+ custom_visibility_title: string;
25
+ };
26
+ ui: {
27
+ draw: {
28
+ line: string;
29
+ area: string;
30
+ area_no_label: string;
31
+ circle: string;
32
+ circle_no_label: string;
33
+ polygon: string;
34
+ polygon_point_intercept: string;
35
+ polygon_finish_fallback: string;
36
+ polygon_no_label: string;
37
+ };
38
+ add: {
39
+ marker: string;
40
+ line: string;
41
+ area: string;
42
+ circle: string;
43
+ circle123: string;
44
+ polygon: string;
45
+ polyline: string;
46
+ icon: string;
47
+ svg: string;
48
+ marker_with_label: string;
49
+ label: string;
50
+ rectangle: string;
51
+ info_window: string;
52
+ ring: string;
53
+ ring_test: string;
54
+ heatmap: string;
55
+ };
56
+ test: {
57
+ set_highlight: string;
58
+ toggle_highlight: string;
59
+ };
60
+ heatmap: {
61
+ auto_on: string;
62
+ auto_off: string;
63
+ lod_coarse: string;
64
+ lod_medium: string;
65
+ lod_fine: string;
66
+ };
67
+ };
68
+ draw: {
69
+ start: {
70
+ line: string;
71
+ rectangle: string;
72
+ rectangle_no_label: string;
73
+ circle: string;
74
+ circle_no_label: string;
75
+ polygon: string;
76
+ polygon_no_label: string;
77
+ polygon_point_intercept: string;
78
+ polygon_finish_fallback: string;
79
+ };
80
+ done: {
81
+ line: string;
82
+ rectangle: string;
83
+ rectangle_no_label: string;
84
+ circle: string;
85
+ circle_no_label: string;
86
+ polygon: string;
87
+ polygon_no_label: string;
88
+ polygon_point_intercept_ok: string;
89
+ polygon_point_intercept_end: string;
90
+ polygon_finish_fallback_ok: string;
91
+ polygon_finish_fallback_blocked: string;
92
+ };
93
+ };
94
+ overlay: {
95
+ marker_mode: string;
96
+ marker_added: string;
97
+ marker_position: string;
98
+ sample_marker_label: string;
99
+ sample_marker_added: string;
100
+ icon_added: string;
101
+ icon_clicked: string;
102
+ svg_added: string;
103
+ svg_clicked: string;
104
+ polyline_added: string;
105
+ polyline_clicked: string;
106
+ line_added: string;
107
+ line_clicked: string;
108
+ area_added: string;
109
+ area_a_clicked: string;
110
+ area_b_clicked: string;
111
+ circle_added: string;
112
+ circle_a_clicked: string;
113
+ circle_b_clicked: string;
114
+ circle_c_clicked: string;
115
+ circle_d_clicked: string;
116
+ circle_e_clicked: string;
117
+ circle_alarm_clicked: string;
118
+ circle_detect_clicked: string;
119
+ rectangle_added: string;
120
+ rectangle_a_clicked: string;
121
+ rectangle_b_clicked: string;
122
+ rectangle_c_clicked: string;
123
+ rectangle_d_clicked: string;
124
+ rectangle_e_clicked: string;
125
+ highlight_need_rect_b: string;
126
+ highlight_need_rect_e: string;
127
+ info_window_added: string;
128
+ info_clicked: string;
129
+ info_window_title: string;
130
+ info_window_desc: string;
131
+ ring_added: string;
132
+ ring_clicked: string;
133
+ };
134
+ };
135
+ export default zhCN;
package/dist/index.d.ts CHANGED
@@ -3,6 +3,20 @@
3
3
  import type * as Cesium from 'cesium';
4
4
  import type { Viewer, Cartesian3, Entity, Color } from 'cesium';
5
5
 
6
+ export type Locale = 'zh-CN' | 'en-US' | (string & {});
7
+
8
+ export interface I18nLike {
9
+ getLocale(): Locale;
10
+ setLocale(locale: Locale, options?: { persist?: boolean }): void;
11
+ t(key: string, params?: Record<string, any>, localeOverride?: Locale): string;
12
+ onLocaleChange(cb: (locale: Locale) => void): () => void;
13
+ bindElement(el: HTMLElement, key: string, attr?: 'text' | 'title' | 'placeholder', params?: Record<string, any>): void;
14
+ updateTree(root: HTMLElement): void;
15
+ addMessages?(locale: Locale, dict: Record<string, any>, options?: { merge?: boolean }): void;
16
+ setFallbackLocale?(locale: Locale): void;
17
+ configure?(options: { persist?: boolean; useStoredLocale?: boolean; fallbackLocale?: Locale; locale?: Locale }): void;
18
+ }
19
+
6
20
  // 工具栏配置接口(与 CesiumMapModel.ts 保持一致)
7
21
  export interface ToolbarConfig {
8
22
  position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
@@ -15,6 +29,8 @@ export interface ToolbarConfig {
15
29
  boxShadow?: string;
16
30
  zIndex?: number;
17
31
  buttons?: CustomButtonConfig[];
32
+ useI18n?: boolean;
33
+ i18n?: I18nLike;
18
34
  }
19
35
 
20
36
  // 按钮配置接口(内部默认按钮配置使用)
@@ -23,6 +39,7 @@ export interface ButtonConfig {
23
39
  id: string;
24
40
  icon: string;
25
41
  title: string;
42
+ titleKey?: string;
26
43
  size?: number;
27
44
  color?: string;
28
45
  borderColor?: string;
@@ -40,6 +57,7 @@ export interface CustomButtonConfig {
40
57
  id: string;
41
58
  icon: string | HTMLElement | false;
42
59
  title: string;
60
+ titleKey?: string;
43
61
  enabled?: boolean;
44
62
  visible?: boolean;
45
63
  size?: number;
@@ -92,12 +110,15 @@ export interface ZoomCallback {
92
110
  export interface MapType {
93
111
  id: string;
94
112
  name: string;
113
+ nameKey?: string;
95
114
  thumbnail: string;
96
115
  provider: (token: string) => Cesium.ImageryProvider[];
97
116
  terrainProvider?: (token: string) => Cesium.TerrainProvider | null;
98
117
  geoWTFS?: (token: string, viewer: Cesium.Viewer) => any | null;
99
118
  }
100
119
 
120
+ export const i18n: I18nLike;
121
+
101
122
  // 视锥体选项接口
102
123
  export interface FrustumOptions {
103
124
  position?: Cartesian3;
@@ -198,9 +219,10 @@ export interface InitOptions {
198
219
  requestRenderMode?: boolean;
199
220
  token?: string;
200
221
  cesiumToken?: string;
201
- orderIndependentTranslucency?: boolean // 无序半透明度,
202
- fxaa?: boolean, // 启用FXAA后处理抗锯齿
203
- msaaSamples?: number, // MSAA采样数(推荐4或8),
222
+ maximumRenderTimeChange?: number; // 最大渲染时间变化
223
+ orderIndependentTranslucency?: boolean; // 无序半透明度,
224
+ fxaa?: boolean; // 启用FXAA后处理抗锯齿
225
+ msaaSamples?: number; // MSAA采样数(推荐4或8)
204
226
  success?: () => void;
205
227
  cancel?: () => void;
206
228
  mapCenter?: MapCenter;