@aibee/crc-bmap 0.14.14 → 0.14.16

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/lib/meta.json CHANGED
@@ -847,8 +847,19 @@
847
847
  ],
848
848
  "format": "esm"
849
849
  },
850
+ "../lib/src/utils/coordinateTransform.js": {
851
+ "bytes": 1073,
852
+ "imports": [
853
+ {
854
+ "path": "three",
855
+ "kind": "import-statement",
856
+ "external": true
857
+ }
858
+ ],
859
+ "format": "esm"
860
+ },
850
861
  "../lib/src/utils/index.js": {
851
- "bytes": 819,
862
+ "bytes": 858,
852
863
  "imports": [
853
864
  {
854
865
  "path": "../lib/src/utils/timer.js",
@@ -999,6 +1010,11 @@
999
1010
  "path": "../lib/src/utils/geometry.js",
1000
1011
  "kind": "import-statement",
1001
1012
  "original": "./geometry"
1013
+ },
1014
+ {
1015
+ "path": "../lib/src/utils/coordinateTransform.js",
1016
+ "kind": "import-statement",
1017
+ "original": "./coordinateTransform"
1002
1018
  }
1003
1019
  ],
1004
1020
  "format": "esm"
@@ -2381,8 +2397,24 @@
2381
2397
  ],
2382
2398
  "format": "esm"
2383
2399
  },
2400
+ "../src/utils/coordinateTransform.ts": {
2401
+ "bytes": 1186,
2402
+ "imports": [
2403
+ {
2404
+ "path": "three",
2405
+ "kind": "import-statement",
2406
+ "external": true
2407
+ },
2408
+ {
2409
+ "path": "<runtime>",
2410
+ "kind": "import-statement",
2411
+ "external": true
2412
+ }
2413
+ ],
2414
+ "format": "esm"
2415
+ },
2384
2416
  "../src/utils/index.ts": {
2385
- "bytes": 817,
2417
+ "bytes": 856,
2386
2418
  "imports": [
2387
2419
  {
2388
2420
  "path": "../src/utils/timer.ts",
@@ -2533,6 +2565,11 @@
2533
2565
  "path": "../src/utils/geometry.ts",
2534
2566
  "kind": "import-statement",
2535
2567
  "original": "./geometry"
2568
+ },
2569
+ {
2570
+ "path": "../src/utils/coordinateTransform.ts",
2571
+ "kind": "import-statement",
2572
+ "original": "./coordinateTransform"
2536
2573
  }
2537
2574
  ],
2538
2575
  "format": "esm"
@@ -4585,7 +4622,7 @@
4585
4622
  "format": "esm"
4586
4623
  },
4587
4624
  "../lib/src/context/context.js": {
4588
- "bytes": 18026,
4625
+ "bytes": 19442,
4589
4626
  "imports": [
4590
4627
  {
4591
4628
  "path": "core-js/modules/web.dom-collections.iterator.js",
@@ -4864,7 +4901,7 @@
4864
4901
  "format": "esm"
4865
4902
  },
4866
4903
  "../lib/src/bmap.js": {
4867
- "bytes": 21840,
4904
+ "bytes": 22144,
4868
4905
  "imports": [
4869
4906
  {
4870
4907
  "path": "../../../node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_extends.js",
@@ -4901,6 +4938,11 @@
4901
4938
  "kind": "import-statement",
4902
4939
  "original": "./utils"
4903
4940
  },
4941
+ {
4942
+ "path": "../lib/src/utils/index.js",
4943
+ "kind": "import-statement",
4944
+ "original": "./utils"
4945
+ },
4904
4946
  {
4905
4947
  "path": "../lib/src/config.js",
4906
4948
  "kind": "import-statement",
@@ -6140,7 +6182,7 @@
6140
6182
  "format": "esm"
6141
6183
  },
6142
6184
  "../lib/src/plugins/recommend-parking-space/recommand-parking-space.js": {
6143
- "bytes": 1514,
6185
+ "bytes": 1523,
6144
6186
  "imports": [
6145
6187
  {
6146
6188
  "path": "../../../node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_extends.js",
@@ -7157,6 +7199,11 @@
7157
7199
  "kind": "import-statement",
7158
7200
  "external": true
7159
7201
  },
7202
+ {
7203
+ "path": "three",
7204
+ "kind": "import-statement",
7205
+ "external": true
7206
+ },
7160
7207
  {
7161
7208
  "path": "core-js/modules/web.dom-collections.iterator.js",
7162
7209
  "kind": "import-statement",
@@ -9124,6 +9171,7 @@
9124
9171
  "ContextCamera",
9125
9172
  "ContextScene",
9126
9173
  "Control",
9174
+ "CoordinateTransform",
9127
9175
  "CrLoader",
9128
9176
  "CrNavPath",
9129
9177
  "Equipment",
@@ -9302,10 +9350,10 @@
9302
9350
  "bytesInOutput": 208
9303
9351
  },
9304
9352
  "../lib/src/bmap.js": {
9305
- "bytesInOutput": 10820
9353
+ "bytesInOutput": 11039
9306
9354
  },
9307
9355
  "../lib/src/context/context.js": {
9308
- "bytesInOutput": 9017
9356
+ "bytesInOutput": 9423
9309
9357
  },
9310
9358
  "../lib/src/utils/timer.js": {
9311
9359
  "bytesInOutput": 1783
@@ -9400,6 +9448,9 @@
9400
9448
  "../lib/src/utils/geometry.js": {
9401
9449
  "bytesInOutput": 3957
9402
9450
  },
9451
+ "../lib/src/utils/coordinateTransform.js": {
9452
+ "bytesInOutput": 354
9453
+ },
9403
9454
  "../lib/src/operations/selection/selection.js": {
9404
9455
  "bytesInOutput": 3434
9405
9456
  },
@@ -9734,7 +9785,7 @@
9734
9785
  "bytesInOutput": 1638
9735
9786
  },
9736
9787
  "../lib/src/plugins/recommend-parking-space/recommand-parking-space.js": {
9737
- "bytesInOutput": 723
9788
+ "bytesInOutput": 732
9738
9789
  },
9739
9790
  "../lib/src/plugins/recommend-parking-space/recommend.worker.js": {
9740
9791
  "bytesInOutput": 98
@@ -9764,7 +9815,7 @@
9764
9815
  "bytesInOutput": 575
9765
9816
  }
9766
9817
  },
9767
- "bytes": 406133
9818
+ "bytes": 407147
9768
9819
  }
9769
9820
  }
9770
9821
  }
package/lib/src/bmap.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { EventDispatcher, Object3D, Vector3 } from "three";
2
2
  import { Context } from "./context/context";
3
3
  import { Timer, HooksName } from "./utils";
4
+ import { CoordinateTransform } from "./utils";
4
5
  import { Config, ParamsConfig } from "./config";
5
6
  import { Floor, Graphic, ModelOptions, Poi, Poi2, PoiOptionsParam, PoiOptionsParam2 } from "./elements";
6
7
  import { SvgLine, SvgPolygon } from "./elements";
@@ -53,6 +54,7 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
53
54
  currentBuildGround: GraphicOptions | null;
54
55
  observe: ResizeObserver | null;
55
56
  buildingCenter: [number, number];
57
+ coordinateTransform: CoordinateTransform;
56
58
  timer: Timer;
57
59
  plugins: Plugin[];
58
60
  debounceResize: any;
@@ -167,6 +169,7 @@ export declare class BMap extends EventDispatcher<BmapEventMap> {
167
169
  deleteGraphic(graphic: Graphic): void;
168
170
  createGraphicByOptions(options: GraphicOptions): Graphic | undefined;
169
171
  mercatorToWorld(mercator: [number, number]): Vector3;
172
+ worldToMercator(world: Vector3): [number, number];
170
173
  removePoiById(id: string): void;
171
174
  getPoiById(id: string): Poi | Poi2 | undefined;
172
175
  getPois(): (Poi | Poi2)[];
@@ -49,6 +49,10 @@ export interface ContextEventMap {
49
49
  "control-zoom-change": {
50
50
  zoom: number;
51
51
  };
52
+ "click": {
53
+ position: Vector3 | null;
54
+ mercator: [number, number] | null;
55
+ };
52
56
  }
53
57
  export declare class Context extends EventDispatcher<ContextEventMap> {
54
58
  container: HTMLElement;
@@ -0,0 +1,27 @@
1
+ import { Vector3 } from "three";
2
+ export declare class CoordinateTransform {
3
+ private buildingCenter;
4
+ constructor(buildingCenter?: [number, number]);
5
+ /**
6
+ * 设置建筑物中心点
7
+ * @param center 建筑物中心点坐标 [x, y]
8
+ */
9
+ setBuildingCenter(center: [number, number]): void;
10
+ /**
11
+ * 获取建筑物中心点
12
+ * @returns 建筑物中心点坐标 [x, y]
13
+ */
14
+ getBuildingCenter(): [number, number];
15
+ /**
16
+ * 墨卡托坐标转换为3D世界坐标
17
+ * @param mercator 墨卡托坐标 [x, y]
18
+ * @returns 3D世界坐标 Vector3
19
+ */
20
+ mercatorToWorld(mercator: [number, number]): Vector3;
21
+ /**
22
+ * 3D世界坐标转换为墨卡托坐标
23
+ * @param world 3D世界坐标 Vector3
24
+ * @returns 墨卡托坐标 [x, y]
25
+ */
26
+ worldToMercator(world: Vector3): [number, number];
27
+ }
@@ -28,3 +28,4 @@ export * from './worker-pool';
28
28
  export * from './event-dispatcher';
29
29
  export * from './kalman-filter';
30
30
  export * from './geometry';
31
+ export * from './coordinateTransform';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.14.14",
3
+ "version": "0.14.16",
4
4
  "description": "",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.esm.min.js",