viewer2d.contextmenu
Invoked when the user performs a right click inside the viewer.
Example
Usage
const onContextMenu = function (event, location, objectId) {
console.log("viewer2d.contextmenu", "location:", location, "objectId:", objectId);
};
$("#viewer-2d").on("viewer2d.contextmenu", onContextMenu);Parameters
onContextMenu
Function called when the user performs a right click inside the viewer.
Type |
|---|
(event: Object, location: Object, objectId: String?) => Void |
event
location
Coordinates of the position clicked.
Name | Type | Description |
|---|---|---|
x | Number | X coordinate of pointer position in pixels |
y | Number | Y coordinate of pointer position in pixels |
z | Number | Height of the last storey shown in meters |
objectId
Id of the object clicked, undefined if no object under cursor.