bigmap-plugin 1.0.4 → 1.0.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.
- package/README.md +404 -10
- package/dist/bigmap-plugin.js +2468 -1698
- package/dist/bigmap-plugin.umd.cjs +14 -14
- package/dist/index.d.ts +415 -21
- package/dist/libs/bigemap/BigemapElevationContourLayer.js +613 -0
- package/package.json +8 -1
package/dist/index.d.ts
CHANGED
|
@@ -66,9 +66,9 @@ default: boolean;
|
|
|
66
66
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
67
67
|
}>, {
|
|
68
68
|
type: string;
|
|
69
|
+
loading: boolean;
|
|
69
70
|
size: string;
|
|
70
71
|
disabled: boolean;
|
|
71
|
-
loading: boolean;
|
|
72
72
|
block: boolean;
|
|
73
73
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
74
74
|
|
|
@@ -665,12 +665,106 @@ export declare class ConfigManager {
|
|
|
665
665
|
reset(): void;
|
|
666
666
|
}
|
|
667
667
|
|
|
668
|
-
/**
|
|
669
|
-
declare interface
|
|
670
|
-
/**
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
|
|
668
|
+
/** 等高线高程色带节点(height 为高程米数,color 为对应颜色) */
|
|
669
|
+
export declare interface ContourColorStop {
|
|
670
|
+
/** 高程(m) */
|
|
671
|
+
height: number;
|
|
672
|
+
/** 该高程对应的颜色(CSS 颜色字符串) */
|
|
673
|
+
color: string;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* 等高线显示配置(3D 模式"等高线"开关参数)。
|
|
678
|
+
* 字段与随包发布的 BigemapElevationContourLayer 一一对应,未配置项使用库内置默认值。
|
|
679
|
+
*/
|
|
680
|
+
export declare interface ContourConfig {
|
|
681
|
+
/** 等高距(m,默认 150) */
|
|
682
|
+
contourSpacing?: number;
|
|
683
|
+
/** 彩色主线宽度(px,默认 2) */
|
|
684
|
+
contourWidth?: number;
|
|
685
|
+
/** 黑色描边宽度(px,默认 2) */
|
|
686
|
+
outlineWidth?: number;
|
|
687
|
+
/** 每隔多少条等高线显示一个高程标签(默认 5) */
|
|
688
|
+
labelEvery?: number;
|
|
689
|
+
/** 当前视区最多显示的高程标签数量(默认 28) */
|
|
690
|
+
maxLabels?: number;
|
|
691
|
+
/** 标签之间的最小屏幕间距(px,默认 140) */
|
|
692
|
+
labelMinDistance?: number;
|
|
693
|
+
/** 标签描边宽度(px,默认 3) */
|
|
694
|
+
labelOutlineWidth?: number;
|
|
695
|
+
/** 高程采样步长(px,默认 80) */
|
|
696
|
+
sampleStep?: number;
|
|
697
|
+
/** 视口扫描步长(px,默认 120) */
|
|
698
|
+
scanStep?: number;
|
|
699
|
+
/** 视口边缘留白(px,默认 48) */
|
|
700
|
+
viewportMargin?: number;
|
|
701
|
+
/** 图例色阶间隔(m,默认 500) */
|
|
702
|
+
legendColorStep?: number;
|
|
703
|
+
/** 色带最低高程(m):未配置时取 colorStops 首个节点,或库内置默认值 */
|
|
704
|
+
minHeight?: number;
|
|
705
|
+
/** 色带最高高程(m):未配置时取 colorStops 末个节点,或库内置默认值 */
|
|
706
|
+
maxHeight?: number;
|
|
707
|
+
/** 高程颜色节点(默认使用库内置 20 级色带;配置后默认按首尾节点推导高程范围) */
|
|
708
|
+
colorStops?: ContourColorStop[];
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/** 等高线库加载参数(serverUrl/libsUrl 透传至 ScriptLoader 解析本地库路径) */
|
|
712
|
+
declare interface ContourDeps {
|
|
713
|
+
/** 地图资源服务器地址(本地库不依赖,可省略) */
|
|
714
|
+
serverUrl?: string;
|
|
715
|
+
/** 本地库路径前缀,默认 /libs */
|
|
716
|
+
libsUrl?: string;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/** 高程标签清空结果 */
|
|
720
|
+
export declare interface ContourLabelClearResult {
|
|
721
|
+
/** 清空状态:cleared 已清空 / empty 无标签 / busy 加载中 / destroyed 已销毁 */
|
|
722
|
+
status: 'cleared' | 'empty' | 'busy' | 'destroyed';
|
|
723
|
+
/** 清空后的标签数量(恒为 0) */
|
|
724
|
+
labelCount: number;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/** 高程标签加载结果 */
|
|
728
|
+
export declare interface ContourLabelResult {
|
|
729
|
+
/** 加载状态 */
|
|
730
|
+
status: ContourLabelStatus;
|
|
731
|
+
/** 当前视区内的标签数量 */
|
|
732
|
+
labelCount: number;
|
|
733
|
+
/** 异常信息(status 为 error 时存在) */
|
|
734
|
+
error?: Error;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/** 高程标签加载状态:success 成功 / no-results 无结果 / terrain-loading 地形未就绪 / unsupported SDK 不支持 / hidden 已隐藏 / busy 加载中 / destroyed 已销毁 / error 异常 */
|
|
738
|
+
export declare type ContourLabelStatus = 'success' | 'no-results' | 'terrain-loading' | 'unsupported' | 'hidden' | 'busy' | 'destroyed' | 'error';
|
|
739
|
+
|
|
740
|
+
/** 高程色带图例数据(用于绘制 HTML 图例) */
|
|
741
|
+
export declare interface ContourLegendData {
|
|
742
|
+
/** 色带最低高程(m) */
|
|
743
|
+
minHeight: number;
|
|
744
|
+
/** 色带最高高程(m) */
|
|
745
|
+
maxHeight: number;
|
|
746
|
+
/** 图例色阶间隔(m) */
|
|
747
|
+
legendColorStep: number;
|
|
748
|
+
/** 高程颜色节点(按高程升序) */
|
|
749
|
+
colorStops: ContourColorStop[];
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/** 等高线公开状态(供 UI 更新按钮与提示文案) */
|
|
753
|
+
export declare interface ContourState {
|
|
754
|
+
/** 等高线是否显示 */
|
|
755
|
+
enabled: boolean;
|
|
756
|
+
/** 高程标签是否正在加载 */
|
|
757
|
+
labelsLoading: boolean;
|
|
758
|
+
/** 已加载的固定高程标签数量 */
|
|
759
|
+
labelCount: number;
|
|
760
|
+
/** 等高距(m) */
|
|
761
|
+
contourSpacing: number;
|
|
762
|
+
/** 标注间隔(m,= 等高距 × labelEvery) */
|
|
763
|
+
labelSpacing: number;
|
|
764
|
+
/** 彩色主线宽度(px) */
|
|
765
|
+
contourWidth: number;
|
|
766
|
+
/** 黑色描边宽度(px) */
|
|
767
|
+
outlineWidth: number;
|
|
674
768
|
}
|
|
675
769
|
|
|
676
770
|
/**
|
|
@@ -696,8 +790,11 @@ export declare function createGeoServerWmtsProvider(config: GeoServerSourceConfi
|
|
|
696
790
|
*/
|
|
697
791
|
export declare function createSearchShapeFromDrawEvent(event: DrawEventData | null | undefined): SearchShape | null;
|
|
698
792
|
|
|
699
|
-
/**
|
|
700
|
-
export declare const DEFAULT_CONTOUR_CONFIG:
|
|
793
|
+
/** 默认等高线配置(彩色等高线 + 视区高程标签;colorStops/minHeight/maxHeight 留空由库按内置色带推导) */
|
|
794
|
+
export declare const DEFAULT_CONTOUR_CONFIG: NormalizedContourConfig;
|
|
795
|
+
|
|
796
|
+
/** 默认 KML 加载配置(可按 loadFromUrl / loadFromText 传入的 config 覆盖) */
|
|
797
|
+
export declare const DEFAULT_KML_CONFIG: NormalizedKmlConfig;
|
|
701
798
|
|
|
702
799
|
/** 默认本地库文件路径(随包发布的 bigemap-plot / circleWave 等) */
|
|
703
800
|
export declare const DEFAULT_LIBS_URL = "/libs";
|
|
@@ -1264,6 +1361,194 @@ export declare interface IconTextConfig {
|
|
|
1264
1361
|
/** 判断是否为合法的图标名称 */
|
|
1265
1362
|
export declare function isIconName(name: string): name is IconName;
|
|
1266
1363
|
|
|
1364
|
+
/** KML 加载配置(全部可选,缺省值见 DEFAULT_KML_CONFIG) */
|
|
1365
|
+
export declare interface KmlConfig {
|
|
1366
|
+
/** 默认面填充色(KML 未声明 PolyStyle 时使用),默认 #3d8bff */
|
|
1367
|
+
fillColor?: string;
|
|
1368
|
+
/** 默认面填充透明度(0~1),默认 0.35 */
|
|
1369
|
+
fillAlpha?: number;
|
|
1370
|
+
/**
|
|
1371
|
+
* 填充/轮廓调色板(#rrggbb 数组),默认 [](不启用)
|
|
1372
|
+
* 非空时按要素顺序轮换取色,并覆盖 KML 自身颜色,便于区分相邻区域。
|
|
1373
|
+
*/
|
|
1374
|
+
fillPalette?: string[];
|
|
1375
|
+
/** 默认线颜色,默认 #ffffff */
|
|
1376
|
+
strokeColor?: string;
|
|
1377
|
+
/** 默认线透明度(0~1),默认 1 */
|
|
1378
|
+
strokeAlpha?: number;
|
|
1379
|
+
/** 默认线宽(px),默认 2 */
|
|
1380
|
+
strokeWidth?: number;
|
|
1381
|
+
/** 默认点颜色,默认 #ff3b30 */
|
|
1382
|
+
pointColor?: string;
|
|
1383
|
+
/** 默认点像素大小,默认 8 */
|
|
1384
|
+
pointPixelSize?: number;
|
|
1385
|
+
/** 是否显示要素名称标签(落点取要素代表位置),默认 true */
|
|
1386
|
+
showLabel?: boolean;
|
|
1387
|
+
/** 名称标签文字颜色,默认 #ffffff */
|
|
1388
|
+
labelColor?: string;
|
|
1389
|
+
/** 名称标签字号(px),默认 13 */
|
|
1390
|
+
labelFontSize?: number;
|
|
1391
|
+
/** 名称标签描边颜色,默认 #000000 */
|
|
1392
|
+
labelOutlineColor?: string;
|
|
1393
|
+
/** 是否采用 KML 内联样式(Style/styleUrl/StyleMap),默认 true;false 时统一使用上面的默认配色 */
|
|
1394
|
+
useKmlStyle?: boolean;
|
|
1395
|
+
/** 是否填充面(默认 true;与 KML PolyStyle.fill 同时生效为“与”关系) */
|
|
1396
|
+
showFill?: boolean;
|
|
1397
|
+
/** 是否绘制面外轮廓(默认 true;与 KML PolyStyle.outline 同时生效为“与”关系) */
|
|
1398
|
+
showOutline?: boolean;
|
|
1399
|
+
/** 是否解析 ExtendedData 到 feature.properties,默认 true */
|
|
1400
|
+
extractProperties?: boolean;
|
|
1401
|
+
/** 加载成功后是否自动飞行定位到数据范围,默认 true */
|
|
1402
|
+
autoFlyTo?: boolean;
|
|
1403
|
+
/** 远程加载超时(ms),默认 15000 */
|
|
1404
|
+
timeout?: number;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/** KML 加载错误 */
|
|
1408
|
+
export declare class KmlError extends Error {
|
|
1409
|
+
code: KmlErrorCode;
|
|
1410
|
+
details?: unknown;
|
|
1411
|
+
constructor(message: string, code: KmlErrorCode, details?: unknown);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* KML 加载错误体系
|
|
1416
|
+
* 以 KmlError 统一承载"可预期的失败"(地址无效 / 文本无效 / 解析失败 / 网络失败 / 超时 / 地图未就绪),
|
|
1417
|
+
* 便于调用方按 code 分支处理,并直接展示 error.message 作为用户提示。
|
|
1418
|
+
*/
|
|
1419
|
+
/** KML 加载错误码 */
|
|
1420
|
+
export declare enum KmlErrorCode {
|
|
1421
|
+
/** 地址无效(空值、非字符串、协议不支持或无法解析) */
|
|
1422
|
+
INVALID_URL = "INVALID_URL",
|
|
1423
|
+
/** 文本无效(空值、非字符串或全空白) */
|
|
1424
|
+
INVALID_TEXT = "INVALID_TEXT",
|
|
1425
|
+
/** KML 解析失败(XML 格式错误或根节点不是 <kml>) */
|
|
1426
|
+
PARSE_FAILED = "PARSE_FAILED",
|
|
1427
|
+
/** KML 中未解析到任何可渲染的几何要素 */
|
|
1428
|
+
NO_FEATURES = "NO_FEATURES",
|
|
1429
|
+
/** 网络请求失败(断网、跨域、DNS 等) */
|
|
1430
|
+
NETWORK_FAILED = "NETWORK_FAILED",
|
|
1431
|
+
/** HTTP 状态异常(如 404 / 500) */
|
|
1432
|
+
HTTP_ERROR = "HTTP_ERROR",
|
|
1433
|
+
/** 请求超时 */
|
|
1434
|
+
TIMEOUT = "TIMEOUT",
|
|
1435
|
+
/** 地图未就绪(viewer/entities 或 bmgl 不可用) */
|
|
1436
|
+
MAP_NOT_READY = "MAP_NOT_READY",
|
|
1437
|
+
/** 其他未预期的加载失败 */
|
|
1438
|
+
LOAD_FAILED = "LOAD_FAILED"
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
/** 解析后的 KML 要素(对应一个 Placemark;MultiGeometry 已展开) */
|
|
1442
|
+
export declare interface KmlFeature {
|
|
1443
|
+
/** 要素 ID(KML Placemark 的 id,缺省时按序号生成) */
|
|
1444
|
+
id: string;
|
|
1445
|
+
/** 名称(<name>) */
|
|
1446
|
+
name: string;
|
|
1447
|
+
/** 描述(<description>) */
|
|
1448
|
+
description?: string;
|
|
1449
|
+
/** 是否可见(KML <visibility>0</visibility> 时为 false) */
|
|
1450
|
+
visible: boolean;
|
|
1451
|
+
/** ExtendedData 展开后的键值对(SchemaData/SimpleData 与 Data/value) */
|
|
1452
|
+
properties: Record<string, string>;
|
|
1453
|
+
/** 解析合并后的样式 */
|
|
1454
|
+
style: KmlStyle;
|
|
1455
|
+
/** 该要素包含的几何(已展开 MultiGeometry) */
|
|
1456
|
+
geometries: KmlGeometry[];
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/** 解析后的几何(MultiGeometry 已在解析阶段展开为多个几何,故此处不含 MultiGeometry) */
|
|
1460
|
+
declare type KmlGeometry = KmlPointGeometry | KmlLineStringGeometry | KmlPolygonGeometry;
|
|
1461
|
+
|
|
1462
|
+
/** KML 线几何 */
|
|
1463
|
+
declare interface KmlLineStringGeometry {
|
|
1464
|
+
type: 'LineString';
|
|
1465
|
+
/** 折线坐标序列(至少 2 个有效点) */
|
|
1466
|
+
coordinates: Coordinate[];
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/** KML 加载成功后的结果 */
|
|
1470
|
+
declare interface KmlLoadResult {
|
|
1471
|
+
/** 数据来源 */
|
|
1472
|
+
source: 'url' | 'text';
|
|
1473
|
+
/** 数据来源地址(source 为 url 时有效) */
|
|
1474
|
+
url: string;
|
|
1475
|
+
/** 要素(Placemark)数量 */
|
|
1476
|
+
featureCount: number;
|
|
1477
|
+
/** 面(Polygon)数量 */
|
|
1478
|
+
polygonCount: number;
|
|
1479
|
+
/** 线(LineString)数量 */
|
|
1480
|
+
lineCount: number;
|
|
1481
|
+
/** 点(Point)数量 */
|
|
1482
|
+
pointCount: number;
|
|
1483
|
+
/** 解析后的要素列表(含 ExtendedData 属性,可供弹窗等二次消费) */
|
|
1484
|
+
features: KmlFeature[];
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/** KML 点几何 */
|
|
1488
|
+
declare interface KmlPointGeometry {
|
|
1489
|
+
type: 'Point';
|
|
1490
|
+
/** 点坐标(取 KML coordinates 的首个三元组) */
|
|
1491
|
+
coordinates: Coordinate;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
/** KML 面几何 */
|
|
1495
|
+
declare interface KmlPolygonGeometry {
|
|
1496
|
+
type: 'Polygon';
|
|
1497
|
+
/** 外环坐标(对应 outerBoundaryIs) */
|
|
1498
|
+
outer: Coordinate[];
|
|
1499
|
+
/** 内环(洞)坐标列表(对应 innerBoundaryIs,可多个) */
|
|
1500
|
+
holes: Coordinate[][];
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
/** KML 加载状态(响应式) */
|
|
1504
|
+
export declare interface KmlState {
|
|
1505
|
+
/** 加载状态:idle 未加载 / loading 加载中 / success 成功 / error 失败 */
|
|
1506
|
+
status: 'idle' | 'loading' | 'success' | 'error';
|
|
1507
|
+
/** 数据来源:url 远程地址 / text 文本;未加载为 null */
|
|
1508
|
+
source: 'url' | 'text' | null;
|
|
1509
|
+
/** 数据来源地址(source 为 url 时有效) */
|
|
1510
|
+
url: string;
|
|
1511
|
+
/** 要素(Placemark)数量 */
|
|
1512
|
+
featureCount: number;
|
|
1513
|
+
/** 面(Polygon)数量 */
|
|
1514
|
+
polygonCount: number;
|
|
1515
|
+
/** 线(LineString)数量 */
|
|
1516
|
+
lineCount: number;
|
|
1517
|
+
/** 点(Point)数量 */
|
|
1518
|
+
pointCount: number;
|
|
1519
|
+
/** 是否显示中(setVisible 控制) */
|
|
1520
|
+
visible: boolean;
|
|
1521
|
+
/** 错误提示(status 为 error 时有效) */
|
|
1522
|
+
error: string | null;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* KML 样式(已归一化为 CSS 颜色 + 0~1 透明度)
|
|
1527
|
+
* 由内联 Style / styleUrl 引用的 Style / StyleMap 合并而来。
|
|
1528
|
+
*/
|
|
1529
|
+
declare interface KmlStyle {
|
|
1530
|
+
/** 面填充色(CSS 颜色),来自 PolyStyle.color */
|
|
1531
|
+
fillColor?: string;
|
|
1532
|
+
/** 面填充透明度(0~1),来自 PolyStyle.color 的 alpha 分量 */
|
|
1533
|
+
fillAlpha?: number;
|
|
1534
|
+
/** 线颜色(CSS 颜色),来自 LineStyle.color */
|
|
1535
|
+
lineColor?: string;
|
|
1536
|
+
/** 线透明度(0~1),来自 LineStyle.color 的 alpha 分量 */
|
|
1537
|
+
lineAlpha?: number;
|
|
1538
|
+
/** 线宽(px),来自 LineStyle.width */
|
|
1539
|
+
lineWidth?: number;
|
|
1540
|
+
/** 点/图标颜色,来自 IconStyle.color */
|
|
1541
|
+
iconColor?: string;
|
|
1542
|
+
/** 图标地址,来自 IconStyle.Icon.href */
|
|
1543
|
+
iconHref?: string;
|
|
1544
|
+
/** 图标缩放,来自 IconStyle.scale */
|
|
1545
|
+
iconScale?: number;
|
|
1546
|
+
/** PolyStyle.fill:false 表示不填充(未声明时视为填充) */
|
|
1547
|
+
fill?: boolean;
|
|
1548
|
+
/** PolyStyle.outline:false 表示不绘制外轮廓(未声明时视为绘制) */
|
|
1549
|
+
outline?: boolean;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1267
1552
|
/** 图层配置 */
|
|
1268
1553
|
export declare interface LayerConfig {
|
|
1269
1554
|
id: string;
|
|
@@ -1345,7 +1630,7 @@ export declare const logger: {
|
|
|
1345
1630
|
export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
1346
1631
|
|
|
1347
1632
|
/** MapView 从 MapConfig 消费的字段清单(单一来源:MapViewProps 类型与组件 config 映射均由此派生) */
|
|
1348
|
-
declare const MAP_VIEW_CONFIG_KEYS: readonly ["containerId", "position", "serverUrl", "accessToken", "libsUrl", "showSearch", "showControls", "showDeleteControls", "showStatus", "tools", "searchDebounceTime", "wmtsUrlProvider", "geoserver", "contourConfig", "lightingConfig"];
|
|
1633
|
+
declare const MAP_VIEW_CONFIG_KEYS: readonly ["containerId", "position", "serverUrl", "accessToken", "libsUrl", "mapId", "terrainId", "baseLayers", "showSearch", "showControls", "showDeleteControls", "showStatus", "tools", "searchDebounceTime", "wmtsUrlProvider", "geoserver", "contourConfig", "lightingConfig"];
|
|
1349
1634
|
|
|
1350
1635
|
/** 地图实例 API(MapContainer/MapView 组件 expose 的完整能力集) */
|
|
1351
1636
|
export declare interface MapApi {
|
|
@@ -1379,8 +1664,16 @@ export declare interface MapApi {
|
|
|
1379
1664
|
deleteEntity: (id?: string) => boolean;
|
|
1380
1665
|
/** 切换"地图名称"注记开关 */
|
|
1381
1666
|
setMapNameVisible: (visible: boolean) => void;
|
|
1382
|
-
/**
|
|
1383
|
-
setContourVisible: (visible: boolean) => void
|
|
1667
|
+
/** 切换彩色等高线显示(仅 3D 模式有效,2D 自动关闭;首次开启时按需加载等高线库) */
|
|
1668
|
+
setContourVisible: (visible: boolean) => Promise<void>;
|
|
1669
|
+
/** 等高线状态(响应式:enabled/labelsLoading/labelCount/contourSpacing/labelSpacing/contourWidth/outlineWidth) */
|
|
1670
|
+
contourState: Ref<ContourState>;
|
|
1671
|
+
/** 加载当前视区高程标签(需先开启等高线) */
|
|
1672
|
+
loadContourLabels: () => Promise<ContourLabelResult>;
|
|
1673
|
+
/** 移除全部高程标签(不影响影像与等高线材质) */
|
|
1674
|
+
clearContourLabels: () => ContourLabelClearResult;
|
|
1675
|
+
/** 获取高程色带图例数据(未开启等高线时返回 null) */
|
|
1676
|
+
getContourLegend: () => ContourLegendData | null;
|
|
1384
1677
|
/** 轨迹回放状态(响应式:status/currentTime/duration/progress/pointCount) */
|
|
1385
1678
|
trajectoryState: Ref<TrajectoryState>;
|
|
1386
1679
|
/** 加载轨迹并创建可视化(2D/3D 均可用;成功且 autoPlay 时自动播放) */
|
|
@@ -1405,6 +1698,16 @@ export declare interface MapApi {
|
|
|
1405
1698
|
setMaskVisible: (visible: boolean) => void;
|
|
1406
1699
|
/** 清除遮罩并复位状态 */
|
|
1407
1700
|
clearMask: () => void;
|
|
1701
|
+
/** KML 加载状态(响应式:status/source/各类计数/visible/error) */
|
|
1702
|
+
kmlState: Ref<KmlState>;
|
|
1703
|
+
/** 通过 KML 文件 URL 加载并渲染(失败时 reject KmlError,并写入 kmlState.error) */
|
|
1704
|
+
loadKmlFromUrl: (url: string, config?: Partial<KmlConfig>) => Promise<KmlLoadResult>;
|
|
1705
|
+
/** 通过 KML 文本内容加载并渲染(失败时 reject KmlError,并写入 kmlState.error) */
|
|
1706
|
+
loadKmlFromText: (text: string, config?: Partial<KmlConfig>) => Promise<KmlLoadResult>;
|
|
1707
|
+
/** 切换 KML 数据显隐(保留已加载数据) */
|
|
1708
|
+
setKmlVisible: (visible: boolean) => void;
|
|
1709
|
+
/** 清空 KML 数据与实体并复位状态 */
|
|
1710
|
+
clearKml: () => void;
|
|
1408
1711
|
/** 天气状态(响应式:type/active) */
|
|
1409
1712
|
weatherState: Ref<WeatherState>;
|
|
1410
1713
|
/** 切换天气特效(clear=晴/无;rain=下雨;snow=下雪),2D/3D 通用 */
|
|
@@ -1456,6 +1759,11 @@ export declare interface MapConfig {
|
|
|
1456
1759
|
mapId?: string;
|
|
1457
1760
|
/** 地形ID */
|
|
1458
1761
|
terrainId?: string;
|
|
1762
|
+
/**
|
|
1763
|
+
* 底图图层 mapId 列表(按数组顺序自下而上叠加)。
|
|
1764
|
+
* 传入则按传入值加载(配置优先);未传入时回退默认底图(卫星影像 + 街道地名)。
|
|
1765
|
+
*/
|
|
1766
|
+
baseLayers?: string[];
|
|
1459
1767
|
/** 是否显示加载动画 */
|
|
1460
1768
|
showLoading?: boolean;
|
|
1461
1769
|
/** 是否显示顶部搜索组件 */
|
|
@@ -1519,6 +1827,18 @@ libsUrl: {
|
|
|
1519
1827
|
type: PropType<string | undefined>;
|
|
1520
1828
|
default: undefined;
|
|
1521
1829
|
};
|
|
1830
|
+
mapId: {
|
|
1831
|
+
type: PropType<string | undefined>;
|
|
1832
|
+
default: undefined;
|
|
1833
|
+
};
|
|
1834
|
+
terrainId: {
|
|
1835
|
+
type: PropType<string | undefined>;
|
|
1836
|
+
default: undefined;
|
|
1837
|
+
};
|
|
1838
|
+
baseLayers: {
|
|
1839
|
+
type: PropType<string[] | undefined>;
|
|
1840
|
+
default: undefined;
|
|
1841
|
+
};
|
|
1522
1842
|
showSearch: {
|
|
1523
1843
|
type: PropType<boolean | undefined>;
|
|
1524
1844
|
default: undefined;
|
|
@@ -1600,6 +1920,18 @@ libsUrl: {
|
|
|
1600
1920
|
type: PropType<string | undefined>;
|
|
1601
1921
|
default: undefined;
|
|
1602
1922
|
};
|
|
1923
|
+
mapId: {
|
|
1924
|
+
type: PropType<string | undefined>;
|
|
1925
|
+
default: undefined;
|
|
1926
|
+
};
|
|
1927
|
+
terrainId: {
|
|
1928
|
+
type: PropType<string | undefined>;
|
|
1929
|
+
default: undefined;
|
|
1930
|
+
};
|
|
1931
|
+
baseLayers: {
|
|
1932
|
+
type: PropType<string[] | undefined>;
|
|
1933
|
+
default: undefined;
|
|
1934
|
+
};
|
|
1603
1935
|
showSearch: {
|
|
1604
1936
|
type: PropType<boolean | undefined>;
|
|
1605
1937
|
default: undefined;
|
|
@@ -1662,6 +1994,9 @@ containerId: string | undefined;
|
|
|
1662
1994
|
serverUrl: string | undefined;
|
|
1663
1995
|
accessToken: string | undefined;
|
|
1664
1996
|
libsUrl: string | undefined;
|
|
1997
|
+
mapId: string | undefined;
|
|
1998
|
+
terrainId: string | undefined;
|
|
1999
|
+
baseLayers: string[] | undefined;
|
|
1665
2000
|
showSearch: boolean | undefined;
|
|
1666
2001
|
showControls: boolean | undefined;
|
|
1667
2002
|
showDeleteControls: boolean | undefined;
|
|
@@ -2284,12 +2619,28 @@ export declare interface NoResultsPanelProps {
|
|
|
2284
2619
|
error?: boolean;
|
|
2285
2620
|
}
|
|
2286
2621
|
|
|
2622
|
+
/** 合并默认等高线配置(colorStops/minHeight/maxHeight 留空由库推导) */
|
|
2623
|
+
export declare function normalizeContourConfig(config?: Partial<ContourConfig>): NormalizedContourConfig;
|
|
2624
|
+
|
|
2625
|
+
/**
|
|
2626
|
+
* 归一化后的等高线配置。
|
|
2627
|
+
* colorStops / minHeight / maxHeight 允许留空:由库按内置色带或自定义色带首尾节点推导,
|
|
2628
|
+
* 因此不能填入默认值(否则会覆盖"按 colorStops 推导高程范围"的库内逻辑)。
|
|
2629
|
+
*/
|
|
2630
|
+
declare type NormalizedContourConfig = Omit<Required<ContourConfig>, 'colorStops' | 'minHeight' | 'maxHeight'> & Partial<Pick<ContourConfig, 'colorStops' | 'minHeight' | 'maxHeight'>>;
|
|
2631
|
+
|
|
2632
|
+
/** 归一化后的 KML 配置 */
|
|
2633
|
+
declare type NormalizedKmlConfig = Required<KmlConfig>;
|
|
2634
|
+
|
|
2287
2635
|
/** 归一化后的遮罩配置(outerRing 可选,运行时按保留区域自动推导) */
|
|
2288
2636
|
declare type NormalizedMaskConfig = Omit<Required<MaskConfig>, 'outerRing'> & {
|
|
2289
2637
|
/** 遮罩覆盖范围外环:默认根据保留区域边界自动外扩推导(避开整环球无法渲染);可显式指定更大覆盖(含全球) */
|
|
2290
2638
|
outerRing?: Coordinate[];
|
|
2291
2639
|
};
|
|
2292
2640
|
|
|
2641
|
+
/** 合并默认 KML 配置 */
|
|
2642
|
+
export declare function normalizeKmlConfig(config?: Partial<KmlConfig>): NormalizedKmlConfig;
|
|
2643
|
+
|
|
2293
2644
|
/** 合并默认遮罩配置 */
|
|
2294
2645
|
export declare function normalizeMaskConfig(config?: Partial<MaskConfig>): NormalizedMaskConfig;
|
|
2295
2646
|
|
|
@@ -2772,21 +3123,30 @@ export declare function useMapCircleWave(map: Ref<MapViewer | null> | MapViewer
|
|
|
2772
3123
|
};
|
|
2773
3124
|
|
|
2774
3125
|
/**
|
|
2775
|
-
*
|
|
3126
|
+
* 彩色等高线显示控制
|
|
2776
3127
|
* @param map 地图实例引用
|
|
2777
3128
|
* @param config 等高线配置(可选项,未配置使用默认常量)
|
|
3129
|
+
* @param deps 按需加载等高线库所需参数(serverUrl / libsUrl)
|
|
2778
3130
|
*/
|
|
2779
|
-
export declare function useMapContour(map: Ref<MapViewer | null>, config?: Partial<ContourConfig
|
|
3131
|
+
export declare function useMapContour(map: Ref<MapViewer | null>, config?: Partial<ContourConfig>, deps?: ContourDeps): UseMapContourResult;
|
|
2780
3132
|
|
|
2781
3133
|
/** useMapContour 返回值 */
|
|
2782
|
-
declare interface UseMapContourResult {
|
|
2783
|
-
/**
|
|
3134
|
+
export declare interface UseMapContourResult {
|
|
3135
|
+
/** 等高线开关状态(响应式) */
|
|
2784
3136
|
contourVisible: Ref<boolean>;
|
|
2785
|
-
/**
|
|
2786
|
-
|
|
2787
|
-
/**
|
|
3137
|
+
/** 等高线公开状态(响应式) */
|
|
3138
|
+
contourState: Ref<ContourState>;
|
|
3139
|
+
/** 切换等高线显隐(首次开启时按需加载彩色等高线库) */
|
|
3140
|
+
setContourVisible: (visible: boolean) => Promise<void>;
|
|
3141
|
+
/** 加载当前视区高程标签(需先开启等高线) */
|
|
3142
|
+
loadLabels: () => Promise<ContourLabelResult>;
|
|
3143
|
+
/** 移除全部高程标签(不影响影像与等高线材质) */
|
|
3144
|
+
clearLabels: () => ContourLabelClearResult;
|
|
3145
|
+
/** 获取高程色带图例数据(等高线库未就绪时返回 null) */
|
|
3146
|
+
getLegendData: () => ContourLegendData | null;
|
|
3147
|
+
/** 切回 3D 时按当前开关状态恢复等高线 */
|
|
2788
3148
|
reapply: () => void;
|
|
2789
|
-
/**
|
|
3149
|
+
/** 切到 2D 时移除地表材质(保留开关状态与已加载标签) */
|
|
2790
3150
|
remove: () => void;
|
|
2791
3151
|
}
|
|
2792
3152
|
|
|
@@ -2825,6 +3185,38 @@ export declare function useMapEntity(map: Ref<MapViewer | null>): {
|
|
|
2825
3185
|
getCurrentEntityId: () => string;
|
|
2826
3186
|
};
|
|
2827
3187
|
|
|
3188
|
+
/**
|
|
3189
|
+
* KML 数据加载
|
|
3190
|
+
*
|
|
3191
|
+
* @param map 地图实例引用
|
|
3192
|
+
* @param config 默认配置(可选项,loadFromUrl/loadFromText 时可按次覆盖)
|
|
3193
|
+
*/
|
|
3194
|
+
export declare function useMapKml(map: Ref<MapViewer | null>, config?: Partial<KmlConfig>): UseMapKmlResult;
|
|
3195
|
+
|
|
3196
|
+
/** useMapKml 返回值 */
|
|
3197
|
+
export declare interface UseMapKmlResult {
|
|
3198
|
+
/** 加载状态(响应式:status/source/各类计数/visible/error) */
|
|
3199
|
+
state: Ref<KmlState>;
|
|
3200
|
+
/** 通过 KML 文件 URL 加载(远程地址,支持相对地址) */
|
|
3201
|
+
loadFromUrl: (url: string, config?: Partial<KmlConfig>) => Promise<KmlLoadResult>;
|
|
3202
|
+
/** 通过 KML 文本内容加载 */
|
|
3203
|
+
loadFromText: (text: string, config?: Partial<KmlConfig>) => Promise<KmlLoadResult>;
|
|
3204
|
+
/** 取最近一次加载解析出的要素(含 ExtendedData 属性,供二次消费) */
|
|
3205
|
+
getFeatures: () => KmlFeature[];
|
|
3206
|
+
/** 整体显隐(保留已加载数据与实体) */
|
|
3207
|
+
setVisible: (visible: boolean) => void;
|
|
3208
|
+
/** 飞行定位到已加载数据的范围(无数据时为空操作) */
|
|
3209
|
+
flyTo: () => void;
|
|
3210
|
+
/** 移除可视化实体(保留已加载数据与状态,供卸载等场景) */
|
|
3211
|
+
remove: () => void;
|
|
3212
|
+
/** 清空数据与实体并复位状态 */
|
|
3213
|
+
clear: () => void;
|
|
3214
|
+
/** 按当前 2D/3D 模式重建可视化(模式切换后由内部自动调用,也支持手动调用) */
|
|
3215
|
+
reapply: () => void;
|
|
3216
|
+
/** 彻底清理(移除实体 + 取消模式监听 + 复位状态) */
|
|
3217
|
+
destroy: () => void;
|
|
3218
|
+
}
|
|
3219
|
+
|
|
2828
3220
|
/**
|
|
2829
3221
|
* 地图图层管理 Hook
|
|
2830
3222
|
*
|
|
@@ -2999,10 +3391,12 @@ export declare function useMapView(props: MapViewProps, hooks: MapViewHooks): {
|
|
|
2999
3391
|
onDelete: () => void;
|
|
3000
3392
|
handleStartDrawing: (drawType: DrawType) => void;
|
|
3001
3393
|
setMapNameVisible: (visible: boolean) => void;
|
|
3002
|
-
setContourVisible: (visible: boolean) => void
|
|
3394
|
+
setContourVisible: (visible: boolean) => Promise<void>;
|
|
3003
3395
|
contourVisible: Ref<boolean, boolean>;
|
|
3396
|
+
contourState: Ref<ContourState, ContourState>;
|
|
3004
3397
|
trajectoryState: Ref<TrajectoryState, TrajectoryState>;
|
|
3005
3398
|
maskState: Ref<MaskState, MaskState>;
|
|
3399
|
+
kmlState: Ref<KmlState, KmlState>;
|
|
3006
3400
|
weatherState: Ref<WeatherState, WeatherState>;
|
|
3007
3401
|
lightingState: Ref<LightingState, LightingState>;
|
|
3008
3402
|
setTheme: (theme: Theme) => void;
|