bbl-mapbox-react 0.0.25 → 0.0.26

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/types.d.ts CHANGED
@@ -606,6 +606,23 @@ export interface MapboxRef {
606
606
  * 仅在 picker 模式下有效
607
607
  */
608
608
  clearPickedLocation: () => void;
609
+ /**
610
+ * 函数式选址
611
+ * 自动进入选址模式,左键点击选址成功并返回结果,右键取消返回 null
612
+ * 选址完成后自动恢复之前的模式
613
+ *
614
+ * @param options 选址配置(不含 value)
615
+ * @returns Promise,选址成功返回 PickerResult,右键取消返回 null
616
+ *
617
+ * @example
618
+ * const result = await mapboxRef.current?.startPicking({ showCrosshair: true });
619
+ * if (result) {
620
+ * console.log('选址成功:', result.lng, result.lat);
621
+ * } else {
622
+ * console.log('选址已取消');
623
+ * }
624
+ */
625
+ startPicking: (options?: StartPickingOptions) => Promise<PickerResult | null>;
609
626
  /**
610
627
  * 开始绘制
611
628
  * 自动进入编辑模式并根据参数类型选择绘制工具
@@ -813,6 +830,10 @@ export interface PickerResult {
813
830
  /** 地址(预留,需要逆地理编码服务) */
814
831
  address?: string;
815
832
  }
833
+ /**
834
+ * 函数式选址配置(不含 value)
835
+ */
836
+ export type StartPickingOptions = Omit<PickerModeConfig, 'value'>;
816
837
  /**
817
838
  * 选址模式配置
818
839
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bbl-mapbox-react",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "React Mapbox 地图组件库,支持雷达、图像、标记、轨迹等多种 GIS 实体渲染",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",