vis-core 0.32.3 → 0.32.4

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/dist/index.d.ts CHANGED
@@ -132,6 +132,12 @@ export declare class Base extends Camera {
132
132
  private createRuntime;
133
133
  private sceneActive;
134
134
  setSceneActive(): void;
135
+ /**
136
+ * Bloom and shadow-map configuration live on the shared renderer/composer,
137
+ * rather than on an individual Pencil page. Reapply the active page's saved
138
+ * values whenever a cached scene becomes active again.
139
+ */
140
+ private applySceneRenderState;
135
141
  /** 把 Pencil 生命周期交给外部场景管理器,当前实例仅拥有自己的 page。 */
136
142
  releasePencilOwnership(): void;
137
143
  private initSceneUserData;
@@ -527,6 +533,9 @@ declare class Map_2 extends Base {
527
533
  /** 当前已恢复或生成的主地图区域;空场景为 undefined。 */
528
534
  get adcode(): number | undefined;
529
535
  activePlaneMap: PlaneMap | null;
536
+ /** 宿主大屏图表等遮挡形成的运行时安全区;不写入场景 options。 */
537
+ private safeAreaInsets;
538
+ private safeAreaRefitPending;
530
539
  parentBg: PlaneMap[];
531
540
  continentsBg?: ContinentsBg;
532
541
  group: GroupObject;
@@ -646,7 +655,11 @@ declare class Map_2 extends Base {
646
655
  adcode: number;
647
656
  extrudelineBloom?: boolean;
648
657
  }): Promise<PlaneMap>;
649
- setPadding(padding: [number, number, number, number], fitTo?: boolean, enableTransition?: boolean): void;
658
+ private hasSafeAreaInsets;
659
+ private getEffectiveSafeAreaPadding;
660
+ getSafeAreaInsets(): MapSafeAreaInsets;
661
+ setSafeAreaInsets(insets: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
662
+ refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<void>;
650
663
  findAdcodeInfo(adcode: number): {
651
664
  adcode: number;
652
665
  lng: number;
@@ -736,7 +749,6 @@ declare interface MapOptions extends BaseOptions {
736
749
  continentsBg?: boolean;
737
750
  continentsBgDepth?: number;
738
751
  mapDepth?: number;
739
- mapPadding?: [number, number, number, number];
740
752
  fixGeojson?: Record<string, string>;
741
753
  showDistrict?: boolean;
742
754
  showLabel?: boolean | 'lite';
@@ -797,6 +809,21 @@ export declare interface MapRegionSwitchInteraction {
797
809
  };
798
810
  }
799
811
 
812
+ /** 宿主界面覆盖地图的运行时安全区,单位为 CSS px。 */
813
+ export declare interface MapSafeAreaInsets {
814
+ top: number;
815
+ right: number;
816
+ bottom: number;
817
+ left: number;
818
+ }
819
+
820
+ export declare interface MapSafeAreaOptions {
821
+ /** 设置后是否立即重新适配当前地图。默认 true。 */
822
+ refit?: boolean;
823
+ transition?: boolean;
824
+ smoothTime?: number;
825
+ }
826
+
800
827
  /** 平台导出的运行时对象绑定,使用 Lead 的完整 key,不依赖命名规则。 */
801
828
  declare interface MapSceneBindings {
802
829
  container: string;
@@ -1220,10 +1247,18 @@ export declare class SceneManager extends Event_2 {
1220
1247
  private isSwitching;
1221
1248
  private isRegionSwitching;
1222
1249
  private pencil?;
1250
+ private safeAreaInsets;
1223
1251
  private debugInteraction;
1224
1252
  private enablePickDebug;
1225
1253
  private disposeInactiveScenes;
1226
1254
  constructor(options: SceneManagerInitOptions);
1255
+ private prepareScene;
1256
+ /**
1257
+ * 设置宿主界面的运行时地图安全区。该状态不进入场景文档,并会自动传给
1258
+ * 当前地图、缓存地图和后续创建的地图区域。
1259
+ */
1260
+ setSafeAreaInsets(insets: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
1261
+ getSafeAreaInsets(): MapSafeAreaInsets;
1227
1262
  private captureCamera;
1228
1263
  private playTransition;
1229
1264
  /** 接管一个已经恢复完成的场景,供编辑器首次加载时复用。 */
@@ -1290,6 +1325,8 @@ export declare type SceneManagerInitOptions = SceneManagerOptions & SceneManager
1290
1325
  export declare interface SceneManagerOptions extends Pick<BaseOptions, 'container' | 'controlsContainer' | 'css2DContainer' | 'assetsPrefix' | 'pencilConfig' | 'logarithmicDepthBuffer' | 'tier' | 'observeParentScale'> {
1291
1326
  /** 动态行政区数据访问使用的授权 key。 */
1292
1327
  mapSwitchKey?: string;
1328
+ /** 宿主大屏图表等覆盖区域形成的运行时地图安全区。 */
1329
+ safeAreaInsets?: Partial<MapSafeAreaInsets>;
1293
1330
  }
1294
1331
 
1295
1332
  export declare interface SceneSwitchInteraction {
@@ -1411,7 +1448,7 @@ export { TWEEN }
1411
1448
 
1412
1449
  export { Tween }
1413
1450
 
1414
- export declare const VERSION = "0.32.3";
1451
+ export declare const VERSION = "0.32.4";
1415
1452
 
1416
1453
  export declare interface VisSceneDocument extends SceneDocumentMarker {
1417
1454
  entrySceneId: string;