gis-view-webgl2 0.1.5 → 0.1.6

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.
Files changed (31) hide show
  1. package/README.md +6 -3
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.d.ts +86 -1
  4. package/dist/index.js +1 -1
  5. package/docs/AI/345/257/271/350/257/235/346/261/207/346/200/273.md +64 -0
  6. package/docs/GisView.md +1 -1
  7. package/docs/ai/06-/344/274/232/350/257/235/347/264/242/345/274/225/344/270/216/345/244/215/346/237/245/346/226/271/346/263/225.md +55 -0
  8. package/docs/demos/MinimapDemo.vue +154 -1
  9. package/docs/demos/SearchFilterDemo.vue +113 -1
  10. package/docs/demos/api-index.js +16 -9
  11. package/docs/demos/demos.js +1 -1
  12. package/docs/internals/13-/351/271/260/347/234/274/345/233/276.md +2 -0
  13. package/docs/internals/16-01-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/212.md +13 -2
  14. package/docs/internals/16-03-/344/274/230/345/214/226/344/270/216/345/217/226/350/210/215-/344/270/213.md +11 -1
  15. package/docs/internals/18-/346/200/247/350/203/275/345/256/236/346/265/213/344/270/216WebGPU/350/257/204/344/274/260.md +61 -1
  16. package/docs/manual/03-/351/205/215/347/275/256/351/241/271.md +5 -4
  17. package/docs/manual/04-/344/272/213/344/273/266/344/270/216/345/233/236/350/260/203.md +2 -2
  18. package/docs/manual/05-/347/224/273/350/264/250/344/270/216/346/211/271/351/207/217/346/233/264/346/226/260.md +1 -1
  19. package/docs/manual/14-/350/247/206/345/233/276/344/270/216/347/255/233/351/200/211.md +23 -5
  20. package/docs/manual/16-/345/256/236/344/276/213/346/226/271/346/263/225/346/200/273/350/241/250.md +7 -3
  21. package/docs/manual/17-/345/217/202/346/225/260/351/200/237/346/237/245.md +10 -3
  22. package/docs/manual/18-/351/200/220/346/226/271/346/263/225/347/244/272/344/276/213.md +20 -1
  23. package/docs/manual/19-/350/257/273/346/225/260/344/270/216/346/213/226/346/213/275/351/242/204/350/247/210.md +4 -0
  24. package/docs/manual/20-/346/200/247/350/203/275/344/270/216/345/244/247/346/225/260/346/215/256.md +8 -3
  25. package/docs/manual/21-/350/257/264/346/230/216/344/270/216/345/270/270/350/247/201/351/227/256/351/242/230.md +1 -1
  26. package/docs/steps/README.md +4 -4
  27. package/docs/steps/selftest-demos.html +105 -6
  28. package/docs/steps/selftest-docs.html +3 -3
  29. package/docs/steps/selftest-full.html +42 -1
  30. package/docs/steps/selftest-perf.html +600 -421
  31. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -13,6 +13,20 @@ export interface GisViewCamera {
13
13
  scale: number
14
14
  }
15
15
 
16
+ /** 直接飞相机时的目标:两项都可省略,没写的那一项沿用当前相机 */
17
+ export interface GisViewCameraTarget {
18
+ center?: [number, number]
19
+ scale?: number
20
+ }
21
+
22
+ /** flyToCamera 的选项:时长与缓动,语义与 flyTo 完全一致 */
23
+ export interface GisViewFlyCameraOptions {
24
+ /** 飞行时长(毫秒),缺省 450;<= 0 时立即落位 */
25
+ duration?: number
26
+ /** 缓动,缺省 'ease-in-out';中心线性插值,比例按对数插值 */
27
+ easing?: GisViewCameraEasing
28
+ }
29
+
16
30
  export interface GisViewViewport {
17
31
  /** 视口的 CSS 宽度(**布局像素**:宿主用 CSS zoom / transform 放大时,它不变、视觉尺寸才变) */
18
32
  cssWidth: number
@@ -516,10 +530,16 @@ export interface GisViewMinimapOptions {
516
530
  * 两者离得很远就是这样),只画正在看的那一份 —— 合并只会让两份都看不清
517
531
  */
518
532
  extent?: GisViewMinimapExtent
533
+ /**
534
+ * 动态范围是否跟着当前可见内容重算:默认 false。首次拿到数据 / 底图范围后锁住世界范围,
535
+ * 筛选、删除、隐藏或新增内容都不会改小图的缩放与中心,外围内容消失时鹰眼图和视口框不会自己跳;
536
+ * 打开后才按当前可见数据与底图重新计算。显式改 extent(含直接写固定范围)始终立即生效。
537
+ */
538
+ extentFollowContent?: boolean
519
539
  /**
520
540
  * `extent: 'auto'` 时是否允许范围跟着相机收窄:默认 false,始终按「数据 ∪ 底图」铺。
521
541
  * 打开后,相机落在其中一份范围、而那份在合并结果里不足 6 像素时只画正在看的那一份;
522
- * 数据 / 底图内容消失、相机进出这份范围时鹰眼图会重新计算包围盒。
542
+ * 相机进出这份范围时鹰眼图会重新计算包围盒;extentFollowContent 关闭时用的是锁定下来的那一份范围。
523
543
  */
524
544
  extentFollowCamera?: boolean
525
545
  /** 给小图容器再加一个类名(与内置的 gis-view__minimap 并列),方便用样式表改外观 */
@@ -3794,6 +3814,8 @@ export interface GisViewDataChangePayload {
3794
3814
  lines: GisViewLine[]
3795
3815
  channels: GisViewChannel[]
3796
3816
  counts: { points: number; lines: number; channels: number }
3817
+ /** 数据修订号:每次数据变更 +1;只改全局配置 / 样式时不推,外部缓存据它决定要不要重算 */
3818
+ dataVersion: number
3797
3819
  /** 动到 / 删掉的节点下标(单点更新是那一个,删除是删除前的下标升序,新增是它们在数组里的位置) */
3798
3820
  index?: number
3799
3821
  indexes?: number[]
@@ -5433,6 +5455,18 @@ export interface GisViewPointStyleSnapshot {
5433
5455
  zIndex: number
5434
5456
  }
5435
5457
 
5458
+ /** 一条线路解析之后的样式快照:getLineStyle() 的返回 */
5459
+ export interface GisViewLineStyleSnapshot {
5460
+ index: number
5461
+ /** 样式链(线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale 与缩放联动 */
5462
+ width: number
5463
+ /** 解析后的 RGBA 颜色,四个分量都在 0 ~ 1 */
5464
+ color: [number, number, number, number]
5465
+ /** 0 ~ 1 */
5466
+ opacity: number
5467
+ zIndex: number
5468
+ }
5469
+
5436
5470
  /** 合并时给的上下文:merge.createItem 会拿到它 */
5437
5471
  export interface GisViewMergeContext {
5438
5472
  sourceIndex: number
@@ -6762,6 +6796,26 @@ export interface GisViewFocusOptions {
6762
6796
  mode?: GisViewSelectMode
6763
6797
  }
6764
6798
 
6799
+ /** 相机飞行的缓动:字符串预设,或 (progress 0~1) => eased 0~1 的自定义函数 */
6800
+ export type GisViewCameraEasing = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | ((progress: number) => number)
6801
+
6802
+ /** flyTo 的选项:目标解析、选中与缩放语义与 focusOn 完全一致,另加时长与缓动 */
6803
+ export interface GisViewFlyOptions extends GisViewFocusOptions {
6804
+ /** 飞行时长(毫秒),缺省 450;<= 0 时立即落位 */
6805
+ duration?: number
6806
+ /** 缓动,缺省 'ease-in-out';中心线性插值,比例按对数插值 */
6807
+ easing?: GisViewCameraEasing
6808
+ }
6809
+
6810
+ /** 相机飞行的实时读数:progress 是时间进度(0~1),不是缓动后的值 */
6811
+ export interface GisViewCameraAnimation {
6812
+ active: boolean
6813
+ progress: number
6814
+ duration: number
6815
+ from: GisViewCamera
6816
+ to: GisViewCamera
6817
+ }
6818
+
6765
6819
  /** 导出图片的选项 */
6766
6820
  export interface GisViewExportImageOptions {
6767
6821
  /**
@@ -7382,6 +7436,10 @@ export interface GisViewInstance {
7382
7436
  readonly el: HTMLElement
7383
7437
  readonly canvas: HTMLCanvasElement
7384
7438
  readonly gl: WebGL2RenderingContext | null
7439
+ /** 相机是否正在执行 flyTo 的飞行动画;只读,不触发重绘 */
7440
+ readonly cameraAnimating: boolean
7441
+ /** 数据修订号:数据变更后 +1;只改全局配置 / 样式不变,外部缓存与增量计算据此判断是否重算 */
7442
+ readonly dataVersion: number
7385
7443
  /** 请求重画一帧:自定义 WebGL 层的数据源变了、组件自己不知道时调用 */
7386
7444
  requestRender(): GisViewInstance
7387
7445
  /**
@@ -7567,6 +7625,17 @@ export interface GisViewInstance {
7567
7625
  * `{ select: true, mode }` 顺手把这些要素选上。认不出目标时什么都不做,返回实例便于链式调用。
7568
7626
  */
7569
7627
  focusOn(target: GisViewFocusTargets, options?: GisViewFocusOptions): GisViewInstance
7628
+ /** 平滑飞向与 focusOn 相同的目标;duration / easing 只影响这一次调用 */
7629
+ flyTo(target: GisViewFocusTargets, options?: GisViewFlyOptions): GisViewInstance
7630
+ /**
7631
+ * 直接飞向一个相机目标 `{ center?, scale? }`:不写的那一项沿用当前相机,不经过要素解析。
7632
+ * duration / easing 与 flyTo 同义;参数非法时保持当前相机。
7633
+ */
7634
+ flyToCamera(camera: GisViewCameraTarget, options?: GisViewFlyCameraOptions): GisViewInstance
7635
+ /** 停掉正在跑的相机飞行(停当前帧、不补跳终点);没有动画时是空操作 */
7636
+ stopCameraAnimation(): GisViewInstance
7637
+ /** 当前相机飞行读数;没有动画时 null */
7638
+ getCameraAnimation(): GisViewCameraAnimation | null
7570
7639
  /** 按关键字搜索节点 / 线路 / 通道:只返回命中(不改数据、不改筛选、也不动视角),聚焦与选中交给使用方 */
7571
7640
  search(input: string | GisViewSearchOptions): GisViewSearchResult
7572
7641
  /**
@@ -8220,6 +8289,12 @@ export interface GisViewInstance {
8220
8289
  * 拖拽落点预览拿它核对「预览与落地同一个尺寸」,合并取双方较大值走的也是这一份;下标不存在返回 null
8221
8290
  */
8222
8291
  getPointStyle(index: number): GisViewPointStyleSnapshot | null
8292
+ /**
8293
+ * 线路解析之后的样式快照(width / color / opacity / zIndex):width 取样式链
8294
+ * (线路自身 > 规则 > lineStyle)定下来的原始线宽,不含 lineWidthScale / 缩放联动与热力倍率;
8295
+ * 下标不存在时返回 null。鹰眼图沿用主图线路宽度时用的就是它。
8296
+ */
8297
+ getLineStyle(index: number): GisViewLineStyleSnapshot | null
8223
8298
  /** 按 id / 下标取一条线路(拾取载荷 + path / bounds / color / width);找不到返回 null */
8224
8299
  getLine(ref: GisViewFeatureRef): GisViewLineInfo | null
8225
8300
  /** 按 id / 下标取一条通道(数据那一份 + 成员表 + 分组上下文);找不到返回 null */
@@ -8679,6 +8754,8 @@ export interface GisViewEngine {
8679
8754
  * 合并节点取双方最大尺寸、图标优先目标用的就是它;下标不存在时返回 null
8680
8755
  */
8681
8756
  getPointStyle(index: number): GisViewPointStyleSnapshot | null
8757
+ /** 线路解析之后的样式快照(width / color / opacity / zIndex);下标不存在时返回 null */
8758
+ getLineStyle(index: number): GisViewLineStyleSnapshot | null
8682
8759
 
8683
8760
  /** 某个下标的节点当前还在不在图上:被过滤 / 隐藏掉的不算 */
8684
8761
  isPointVisible(index: number): boolean
@@ -8699,6 +8776,14 @@ export interface GisViewEngine {
8699
8776
  forEachPointInView(rect: GisViewBounds, visit: (index: number, item: GisViewPoint, x: number, y: number, radius: number) => void | boolean): void
8700
8777
  getCamera(): GisViewCamera
8701
8778
  setCamera(camera: Partial<GisViewCamera>): void
8779
+ /** 只算目标相机、不动画面;视口还没量出来时返回 null */
8780
+ getCameraForBounds(bounds: GisViewBounds, padding?: number): GisViewCamera | null
8781
+ /** 相机飞行:target 是终点的 { center, scale },duration / easing 只影响这一次 */
8782
+ flyCamera(target: GisViewCamera, options?: Pick<GisViewFlyOptions, 'duration' | 'easing'>): boolean
8783
+ /** 停掉相机飞行,返回是否真的停了一条正在跑的动画 */
8784
+ stopCameraAnimation(): boolean
8785
+ getCameraAnimation(): GisViewCameraAnimation | null
8786
+ isCameraAnimating(): boolean
8702
8787
  zoomBy(factor: number, origin?: [number, number]): void
8703
8788
  zoomTo(scale: number, origin?: [number, number]): void
8704
8789
  zoomToBounds(bounds: GisViewBounds, padding?: number): void