Events
viewer2d.click
invoked when the user clicks inside the viewer example usage const onclick = function (event) { const { intersects } = event; console log("viewer2d click", "intersects ", intersects); }; viewer2d addeventlistener("viewer2d click", onclick); jquery 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 type (event object) => void event name type description intersects object object below the cursor, undefined if none preventdefault function disable space selection for click event srcevent object original dom event intersects name type description objectid string id of the object point vector3 docid\ gqdk6khl9iuzriegxvdd0 intersection point of the object normal vector3 docid\ gqdk6khl9iuzriegxvdd0 normal vector at the intersection point 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 jquery event https //api jquery com/category/events/event object/ 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