viewer2d.click
Invoked when the user clicks inside the viewer.
Example
Usage
const onClick = function (event, location, objectId) {
console.log("viewer2d.click", "location:", location, "objectId:", objectId);
};
$("#viewer-2d").on("viewer2d.click", onClick);Parameters
onClick
Function called when the user clicks inside the viewer.
Returning false from the onClick function will disable object selection for click event
Type |
|---|
(event: Object, location: Object, objectId: String) => Boolean/Void |
event
location
Coordinates of the position clicked.
Name | Type | Description |
|---|---|---|
x | Number | X coordinate of position clicked in pixels |
y | Number | Y coordinate of position clicked in pixels |
z | Number | Height of the last storey shown in meters |
objectId
Id of the object clicked, undefined if no object under cursor