bbl-mapbox-react 0.0.16 → 0.0.18
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/components/BaseRenderer.d.ts +40 -1
- package/dist/components/CanvasCircleRenderer.d.ts +16 -1
- package/dist/components/CanvasImageRenderer.d.ts +17 -1
- package/dist/components/CanvasRadarRenderer.d.ts +13 -1
- package/dist/components/CircleRenderer.d.ts +21 -1
- package/dist/components/MarkerRenderer.d.ts +10 -1
- package/dist/components/MeasureControl.d.ts +3 -1
- package/dist/components/PolygonRenderer.d.ts +54 -1
- package/dist/components/PolylineRenderer.d.ts +18 -1
- package/dist/components/RectangleRenderer.d.ts +26 -1
- package/dist/components/RoutePlanningControl.d.ts +19 -0
- package/dist/components/SquareRenderer.d.ts +20 -1
- package/dist/index.cjs +5 -5
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2197 -713
- package/dist/types.d.ts +67 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -478,6 +478,13 @@ export interface MapboxProps {
|
|
|
478
478
|
onRasterPaintChange?: (config: RasterPaintConfig) => void;
|
|
479
479
|
/** 栅格渲染调节控件配置 */
|
|
480
480
|
showRasterPaint?: boolean | RasterPaintControlConfig;
|
|
481
|
+
/**
|
|
482
|
+
* 路径规划控件配置
|
|
483
|
+
* - true: 不可用(需要提供 onSelectFinished)
|
|
484
|
+
* - false 或 undefined: 禁用(默认)
|
|
485
|
+
* - 对象: 自定义配置
|
|
486
|
+
*/
|
|
487
|
+
showRoutePlanning?: RoutePlanningControlConfig;
|
|
481
488
|
entities?: MapEntity[];
|
|
482
489
|
selectedIds?: EntityId[];
|
|
483
490
|
/** 实体全局开关配置(showArea / showLength / showRadius),entity 级配置优先 */
|
|
@@ -620,6 +627,21 @@ export interface MapboxRef {
|
|
|
620
627
|
* @returns 渲染器实例,不存在则返回 undefined
|
|
621
628
|
*/
|
|
622
629
|
getRenderer: (id: EntityId) => BaseRenderer<MapEntity> | undefined;
|
|
630
|
+
/**
|
|
631
|
+
* 设置哪些实体开启编辑模式(显示编辑手柄,可交互修改几何形状)
|
|
632
|
+
* @param ids 需要开启编辑的实体 ID 数组,传空数组关闭所有编辑
|
|
633
|
+
*/
|
|
634
|
+
setEditingEntities: (ids: EntityId[]) => void;
|
|
635
|
+
/**
|
|
636
|
+
* 获取当前正在编辑的实体 ID 列表
|
|
637
|
+
*/
|
|
638
|
+
getEditingEntities: () => EntityId[];
|
|
639
|
+
/**
|
|
640
|
+
* 程序化启动路径规划
|
|
641
|
+
* 即使没有显示路径规划控件也可以调用
|
|
642
|
+
* @param options 路径规划选项
|
|
643
|
+
*/
|
|
644
|
+
startRoutePlanning: (options: RoutePlanningOptions) => void;
|
|
623
645
|
}
|
|
624
646
|
export interface RenderContext {
|
|
625
647
|
map: MapboxMap;
|
|
@@ -798,6 +820,10 @@ export interface PickerModeConfig {
|
|
|
798
820
|
* 不传则保持原有的点击选址行为
|
|
799
821
|
*/
|
|
800
822
|
value?: PickerResult;
|
|
823
|
+
/** 标记点显示的文本名称 */
|
|
824
|
+
name?: string;
|
|
825
|
+
/** 文本样式配置 */
|
|
826
|
+
nameConfig?: NameConfig;
|
|
801
827
|
}
|
|
802
828
|
/**
|
|
803
829
|
* Marker 模板定义
|
|
@@ -922,6 +948,19 @@ export interface EditModeConfig {
|
|
|
922
948
|
onPolylineAdd?: (polyline: PolylineEntity) => void;
|
|
923
949
|
/** 删除实体回调 */
|
|
924
950
|
onEntityDelete?: (entity: MapEntity) => void;
|
|
951
|
+
/** 实体几何编辑完成回调(顶点移动、增删等) */
|
|
952
|
+
onEntityEdit?: (entity: MapEntity) => void;
|
|
953
|
+
}
|
|
954
|
+
/** 编辑手柄类型 */
|
|
955
|
+
export type EditHandleType = 'vertex' | 'midpoint' | 'edge' | 'center' | 'move';
|
|
956
|
+
/** 编辑手柄标识 */
|
|
957
|
+
export interface EditHandle {
|
|
958
|
+
/** 手柄类型 */
|
|
959
|
+
type: EditHandleType;
|
|
960
|
+
/** 索引(vertex/midpoint: 坐标索引, edge: 方位索引 0=N 1=E 2=S 3=W, center: 0) */
|
|
961
|
+
index: number;
|
|
962
|
+
/** 当前位置 [经度, 纬度] */
|
|
963
|
+
position: [number, number];
|
|
925
964
|
}
|
|
926
965
|
/**
|
|
927
966
|
* 道路类型
|
|
@@ -978,6 +1017,34 @@ export interface RasterPaintControlConfig {
|
|
|
978
1017
|
/** 自定义样式 */
|
|
979
1018
|
style?: CSSProperties;
|
|
980
1019
|
}
|
|
1020
|
+
/** 选点过程中的可视化类型 */
|
|
1021
|
+
export type RoutePlanningVisualType = 'marker' | 'polyline';
|
|
1022
|
+
/**
|
|
1023
|
+
* 路径规划控件配置
|
|
1024
|
+
*/
|
|
1025
|
+
export interface RoutePlanningControlConfig {
|
|
1026
|
+
/** 是否启用,默认 true */
|
|
1027
|
+
enabled?: boolean;
|
|
1028
|
+
/** 选点数量,最低2,默认2 */
|
|
1029
|
+
pointCount?: number;
|
|
1030
|
+
/** 是否显示输入框让用户自定义点数 */
|
|
1031
|
+
showPointCountInput?: boolean;
|
|
1032
|
+
/** 选点过程中的可视化类型,marker=每个点显示标记,polyline=用折线连接所有点,默认 'marker' */
|
|
1033
|
+
visualType?: RoutePlanningVisualType;
|
|
1034
|
+
/** 选点完成后的回调,接收选中的点坐标数组,返回 entity */
|
|
1035
|
+
onSelectFinished: (points: [number, number][]) => Promise<MapEntity | null>;
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* 路径规划选项(用于程序化调用)
|
|
1039
|
+
*/
|
|
1040
|
+
export interface RoutePlanningOptions {
|
|
1041
|
+
/** 选点数量,最低2,默认2 */
|
|
1042
|
+
pointCount?: number;
|
|
1043
|
+
/** 选点过程中的可视化类型,默认 'marker' */
|
|
1044
|
+
visualType?: RoutePlanningVisualType;
|
|
1045
|
+
/** 选点完成后的回调,接收选中的点坐标数组,返回 entity */
|
|
1046
|
+
onSelectFinished: (points: [number, number][]) => Promise<MapEntity>;
|
|
1047
|
+
}
|
|
981
1048
|
/**
|
|
982
1049
|
* 道路类型选项列表
|
|
983
1050
|
* 兼容 Mapbox 和 OpenMapTiles 的道路分类
|