Interface: ViewerMouseEvent
viewer.ViewerMouseEvent
Interface for mouse-related viewer events.
example
// The `click` event is an example of a `ViewerMouseEvent`.// Set up an event listener on the viewer.viewer.on('click', function(e) { // The event object contains information like the // coordinates of the point in the viewer that was clicked. console.log('A click event has occurred at ' + e.lngLat);});
#
Hierarchy↳
ViewerMouseEvent
#
Properties#
basicPoint• basicPoint: number
[]
The basic coordinates in the current image of the mouse event target.
description
In some situations mouse events can occur outside of
the border of a image. In that case the basic coordinates will be
null
.
The basic point is only provided when the
CameraControls.Street mode is active. For all other camera
control modes, the basic point will be null
.
Basic coordinates are 2D coordinates on the [0, 1] interval and has the origin point, (0, 0), at the top left corner and the maximum value, (1, 1), at the bottom right corner of the original image.
#
Defined inviewer/events/ViewerMouseEvent.ts:36
#
lngLat• lngLat: LngLat
The geographic location in the viewer of the mouse event target.
description
In some situations the viewer can not determine a valid
geographic location for the mouse event target. In that case the
geographic coordinates will be null
.
#
Defined inviewer/events/ViewerMouseEvent.ts:45
#
originalEvent• originalEvent: MouseEvent
The original event that triggered the viewer event.
#
Defined inviewer/events/ViewerMouseEvent.ts:56
#
pixelPoint• pixelPoint: number
[]
The pixel coordinates of the mouse event target, relative to the viewer and measured from the top left corner.
#
Defined inviewer/events/ViewerMouseEvent.ts:51
#
target• target: IViewer
The viewer object that fired the event.
#
Inherited from#
Defined inviewer/events/ViewerEvent.ts:11
#
type• type: "click"
| "contextmenu"
| "dblclick"
| "mousedown"
| "mousemove"
| "mouseout"
| "mouseover"
| "mouseup"
The event type.