@aibee/crc-bmap 0.0.38 → 0.0.39
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/example/src/main.ts +3 -0
- package/lib/bmap.cjs.min.js +2 -2
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +19 -6
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +2 -2
- package/lib/bmap.esm.min.js.map +3 -3
- package/lib/bmap.min.js +2 -2
- package/lib/bmap.min.js.map +3 -3
- package/lib/src/elements/graphic.d.ts +5 -3
- package/lib/src/types/index.d.ts +1 -0
- package/package.json +1 -1
package/lib/bmap.esm.js
CHANGED
|
@@ -401,12 +401,13 @@ import {
|
|
|
401
401
|
Mesh,
|
|
402
402
|
Color as Color2,
|
|
403
403
|
Box3,
|
|
404
|
-
LineSegments,
|
|
405
404
|
EdgesGeometry,
|
|
406
|
-
LineBasicMaterial,
|
|
407
405
|
Vector3
|
|
408
406
|
} from "three";
|
|
409
407
|
import { merge } from "lodash";
|
|
408
|
+
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
|
|
409
|
+
import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeometry.js";
|
|
410
|
+
import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2.js";
|
|
410
411
|
var defaultOptions = {
|
|
411
412
|
id: "",
|
|
412
413
|
// 图形id
|
|
@@ -426,6 +427,8 @@ var defaultOptions = {
|
|
|
426
427
|
// 透明度
|
|
427
428
|
strokeOpacity: 1,
|
|
428
429
|
// 描边透明度
|
|
430
|
+
strokeWidth: 1,
|
|
431
|
+
// 描边宽度
|
|
429
432
|
doors: [],
|
|
430
433
|
// 门配置
|
|
431
434
|
locked: false,
|
|
@@ -472,6 +475,9 @@ var Graphic = class extends Object3D {
|
|
|
472
475
|
this.addEventListener("change-strokeOpacity", ({ value }) => {
|
|
473
476
|
this.line.material.opacity = value;
|
|
474
477
|
});
|
|
478
|
+
this.addEventListener("change-strokeWidth", ({ value }) => {
|
|
479
|
+
this.line.material.linewidth = value;
|
|
480
|
+
});
|
|
475
481
|
this.addEventListener("change-airHeight", ({ value }) => {
|
|
476
482
|
this.position.z = value;
|
|
477
483
|
});
|
|
@@ -538,12 +544,17 @@ var Graphic = class extends Object3D {
|
|
|
538
544
|
return material;
|
|
539
545
|
}
|
|
540
546
|
initLineMaterial() {
|
|
541
|
-
const lineMaterial = new
|
|
542
|
-
color: this.options.strokeColor,
|
|
547
|
+
const lineMaterial = new LineMaterial({
|
|
548
|
+
color: new Color2(this.options.strokeColor).getHex(),
|
|
543
549
|
opacity: this.options.strokeOpacity,
|
|
544
550
|
transparent: true,
|
|
545
|
-
depthWrite: true
|
|
551
|
+
depthWrite: true,
|
|
552
|
+
linewidth: this.options.strokeWidth,
|
|
553
|
+
wireframe: false,
|
|
554
|
+
dashed: false
|
|
546
555
|
});
|
|
556
|
+
const { clientSize: { width, height } } = this.context;
|
|
557
|
+
lineMaterial.resolution.set(width, height);
|
|
547
558
|
return lineMaterial;
|
|
548
559
|
}
|
|
549
560
|
initMesh() {
|
|
@@ -552,7 +563,9 @@ var Graphic = class extends Object3D {
|
|
|
552
563
|
createBorder() {
|
|
553
564
|
const material = this.initLineMaterial();
|
|
554
565
|
const geometry = new EdgesGeometry(this.geometry);
|
|
555
|
-
const
|
|
566
|
+
const lineGeometry = new LineSegmentsGeometry();
|
|
567
|
+
lineGeometry.fromEdgesGeometry(geometry);
|
|
568
|
+
const line = new LineSegments2(lineGeometry, material);
|
|
556
569
|
line.position.z = this.options.airHeight;
|
|
557
570
|
return line;
|
|
558
571
|
}
|