@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.
@@ -44,6 +44,7 @@ interface InitOptions {
44
44
  maximumScreenSpaceError?: number;
45
45
  maximumNumberOfLoadedTiles?: number;
46
46
  requestRenderMode?: boolean;
47
+ maximumRenderTimeChange?: number;
47
48
  token?: string;
48
49
  cesiumToken?: string;
49
50
  success?: () => void;
@@ -1,4 +1,5 @@
1
1
  import { Cartesian3, Cartographic, Color } from '../../node_modules/cesium';
2
+ import { I18nLike } from '../libs/i18n';
2
3
  import * as Cesium from 'cesium';
3
4
  export interface ToolbarConfig {
4
5
  position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
@@ -11,12 +12,15 @@ export interface ToolbarConfig {
11
12
  boxShadow?: string;
12
13
  zIndex?: number;
13
14
  buttons?: CustomButtonConfig[];
15
+ useI18n?: boolean;
16
+ i18n?: I18nLike;
14
17
  }
15
18
  export interface ButtonConfig {
16
19
  sort?: number;
17
20
  id: string;
18
21
  icon: string;
19
22
  title: string;
23
+ titleKey?: string;
20
24
  size?: number;
21
25
  color?: string;
22
26
  borderColor?: string;
@@ -32,6 +36,7 @@ export interface CustomButtonConfig {
32
36
  id: string;
33
37
  icon: string | HTMLElement | false;
34
38
  title: string;
39
+ titleKey?: string;
35
40
  enabled?: boolean;
36
41
  visible?: boolean;
37
42
  size?: number;
@@ -74,6 +79,7 @@ export interface ZoomCallback {
74
79
  export interface MapType {
75
80
  id: string;
76
81
  name: string;
82
+ nameKey?: string;
77
83
  thumbnail: string;
78
84
  provider: (token: string) => Cesium.ImageryProvider[];
79
85
  terrainProvider?: (token: string) => Cesium.TerrainProvider | null;
@@ -29,6 +29,9 @@ export declare class CesiumMapToolbar {
29
29
  private isNoFlyZoneChecked;
30
30
  private currentGeoWTFS;
31
31
  private measurementService;
32
+ private unsubscribeI18n?;
33
+ private i18n;
34
+ private useI18n;
32
35
  readonly measurement: {
33
36
  getMeasureMode: () => "none" | "distance" | "area";
34
37
  };
@@ -0,0 +1,66 @@
1
+ declare const enUS: {
2
+ locale: string;
3
+ toolbar: {
4
+ search: string;
5
+ measure: string;
6
+ view2d3d: string;
7
+ layers: string;
8
+ location: string;
9
+ zoom_in: string;
10
+ zoom_out: string;
11
+ fullscreen: string;
12
+ };
13
+ measurement: {
14
+ start: string;
15
+ distance_done: string;
16
+ area_done: string;
17
+ cleared: string;
18
+ menu: {
19
+ area: string;
20
+ distance: string;
21
+ clear: string;
22
+ };
23
+ };
24
+ search: {
25
+ placeholder: string;
26
+ failed: string;
27
+ no_results: string;
28
+ };
29
+ layers: {
30
+ title: string;
31
+ overlay_title: string;
32
+ overlay: {
33
+ airport: string;
34
+ };
35
+ };
36
+ map_type: {
37
+ normal: string;
38
+ "3d": string;
39
+ imagery: string;
40
+ terrain: string;
41
+ };
42
+ no_fly: {
43
+ description: string;
44
+ };
45
+ draw: {
46
+ hint: {
47
+ circle_start: string;
48
+ circle_radius: string;
49
+ rectangle_start: string;
50
+ rectangle_end: string;
51
+ finish_or_undo: string;
52
+ polygon_start: string;
53
+ polygon_add: string;
54
+ polygon_continue: string;
55
+ line_start: string;
56
+ line_add: string;
57
+ line_continue: string;
58
+ polygon_no_intersection: string;
59
+ };
60
+ label: {
61
+ total_length: string;
62
+ area: string;
63
+ };
64
+ };
65
+ };
66
+ export default enUS;
@@ -0,0 +1,24 @@
1
+ type Locale = "zh-CN" | "en-US" | (string & {});
2
+ type I18nDict = Record<string, any>;
3
+ interface I18nLike {
4
+ getLocale(): Locale;
5
+ setLocale(locale: Locale, options?: {
6
+ persist?: boolean;
7
+ }): void;
8
+ t(key: string, params?: Record<string, any>, localeOverride?: Locale): string;
9
+ onLocaleChange(cb: (locale: Locale) => void): () => void;
10
+ bindElement(el: HTMLElement, key: string, attr?: "text" | "title" | "placeholder", params?: Record<string, any>): void;
11
+ updateTree(root: HTMLElement): void;
12
+ addMessages?(locale: Locale, dict: I18nDict, options?: {
13
+ merge?: boolean;
14
+ }): void;
15
+ setFallbackLocale?(locale: Locale): void;
16
+ configure?(options: {
17
+ persist?: boolean;
18
+ useStoredLocale?: boolean;
19
+ fallbackLocale?: Locale;
20
+ locale?: Locale;
21
+ }): void;
22
+ }
23
+ export declare const i18n: I18nLike;
24
+ export type { Locale, I18nLike };
@@ -0,0 +1,66 @@
1
+ declare const zhCN: {
2
+ locale: string;
3
+ toolbar: {
4
+ search: string;
5
+ measure: string;
6
+ view2d3d: string;
7
+ layers: string;
8
+ location: string;
9
+ zoom_in: string;
10
+ zoom_out: string;
11
+ fullscreen: string;
12
+ };
13
+ measurement: {
14
+ start: string;
15
+ distance_done: string;
16
+ area_done: string;
17
+ cleared: string;
18
+ menu: {
19
+ area: string;
20
+ distance: string;
21
+ clear: string;
22
+ };
23
+ };
24
+ search: {
25
+ placeholder: string;
26
+ failed: string;
27
+ no_results: string;
28
+ };
29
+ layers: {
30
+ title: string;
31
+ overlay_title: string;
32
+ overlay: {
33
+ airport: string;
34
+ };
35
+ };
36
+ map_type: {
37
+ normal: string;
38
+ "3d": string;
39
+ imagery: string;
40
+ terrain: string;
41
+ };
42
+ no_fly: {
43
+ description: string;
44
+ };
45
+ draw: {
46
+ hint: {
47
+ circle_start: string;
48
+ circle_radius: string;
49
+ rectangle_start: string;
50
+ rectangle_end: string;
51
+ finish_or_undo: string;
52
+ polygon_start: string;
53
+ polygon_add: string;
54
+ polygon_continue: string;
55
+ line_start: string;
56
+ line_add: string;
57
+ line_continue: string;
58
+ polygon_no_intersection: string;
59
+ };
60
+ label: {
61
+ total_length: string;
62
+ area: string;
63
+ };
64
+ };
65
+ };
66
+ export default zhCN;
@@ -1,5 +1,6 @@
1
1
  import { Viewer } from '../../../node_modules/cesium';
2
2
  import { MapType } from '../CesiumMapModel';
3
+ import { I18nLike } from '../../libs/i18n';
3
4
  /**
4
5
  * 图层服务配置接口
5
6
  */
@@ -9,6 +10,8 @@ export interface MapLayersServiceConfig {
9
10
  token: string;
10
11
  isNoFlyZoneChecked: boolean;
11
12
  isNoFlyZoneVisible: boolean;
13
+ i18n?: I18nLike;
14
+ useI18n?: boolean;
12
15
  onMapTypeChange?: (mapTypeId: string) => void;
13
16
  onNoFlyZoneToggle?: (isChecked: boolean) => void;
14
17
  onShowNoFlyZones?: () => Promise<void> | void;
@@ -22,6 +25,8 @@ export declare class MapLayersService {
22
25
  private toolbarElement;
23
26
  private config;
24
27
  private currentGeoWTFS;
28
+ private i18n;
29
+ private useI18n;
25
30
  constructor(viewer: Viewer, toolbarElement: HTMLElement, config: MapLayersServiceConfig);
26
31
  /**
27
32
  * 更新配置
@@ -1,5 +1,6 @@
1
1
  import { Viewer } from '../../../node_modules/cesium';
2
2
  import { SearchResult, SearchCallback } from '../CesiumMapModel';
3
+ import { I18nLike } from '../../libs/i18n';
3
4
  /**
4
5
  * 搜索服务类
5
6
  * 负责处理地图搜索相关的所有逻辑
@@ -9,7 +10,12 @@ export declare class SearchService {
9
10
  private toolbarElement;
10
11
  private searchCallback?;
11
12
  private searchContainer;
12
- constructor(viewer: Viewer, toolbarElement: HTMLElement, searchCallback?: SearchCallback);
13
+ private i18n;
14
+ private useI18n;
15
+ constructor(viewer: Viewer, toolbarElement: HTMLElement, searchCallback?: SearchCallback, options?: {
16
+ i18n?: I18nLike;
17
+ useI18n?: boolean;
18
+ });
13
19
  /**
14
20
  * 设置搜索回调
15
21
  */
@@ -1,10 +1,13 @@
1
1
  import { Viewer } from '../../../node_modules/cesium';
2
+ import { I18nLike } from '../../libs/i18n';
2
3
  /**
3
4
  * 禁飞区服务配置接口
4
5
  */
5
6
  export interface NotFlyZonesServiceConfig {
6
7
  extrudedHeight?: number;
7
8
  autoLoad?: boolean;
9
+ i18n?: I18nLike;
10
+ useI18n?: boolean;
8
11
  }
9
12
  /**
10
13
  * 禁飞区服务类
@@ -16,6 +19,8 @@ export declare class NotFlyZonesService {
16
19
  private isNoFlyZoneVisible;
17
20
  private isNoFlyZoneLoading;
18
21
  private readonly extrudedHeight;
22
+ private i18n;
23
+ private useI18n;
19
24
  constructor(viewer: Viewer, config?: NotFlyZonesServiceConfig);
20
25
  /**
21
26
  * 加载并显示机场禁飞区
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.2-alpha.16",
3
+ "version": "0.0.2-alpha.17",
4
4
  "description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.2-alpha.16",
3
+ "version": "0.0.2-alpha.17",
4
4
  "description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",