Skip to content

Commit 580b64f

Browse files
authored
adapt threelayer events when threelayer addto groupgllayer (#598)
1 parent 18c08aa commit 580b64f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ class ThreeLayer extends maptalks.CanvasLayer {
844844
* @param {Object} options
845845
* @return {Array}
846846
*/
847-
identify(coordinate: maptalks.Coordinate, options: object): Array<BaseObject | THREE.Object3D> {
847+
identify(coordinate: maptalks.Coordinate | maptalks.Point, options: object): Array<BaseObject | THREE.Object3D> {
848848
if (!coordinate) {
849849
console.error('coordinate is null,it should be Coordinate');
850850
return [];
@@ -950,6 +950,15 @@ class ThreeLayer extends maptalks.CanvasLayer {
950950
return (maptalks.Util.isNumber(count) && count > 0 ? pickResult.slice(0, count) : baseObjects);
951951
}
952952

953+
identifyAtPoint(point:maptalks.Point, options = {}) {
954+
const map = this.getMap();
955+
if (!map) {
956+
return [];
957+
}
958+
const coordinate = map.containerPointToCoordinate(point);
959+
return this.identify(coordinate, options);
960+
}
961+
953962
/**
954963
* Recursively finding the root node of mesh,Until it is scene node
955964
* @param {*} mesh

0 commit comments

Comments
 (0)