Protected
cursorThe CSS cursor to use on the map, for this controller.
If null
, the map will fall back to the previous cursor that was set on the map.
Note that changing this cursor will update the cursor on the map's DOM node. When using multiple controllers (e.g. in a CompositeController), the controller that updates the cursor last (to a non-null value), will override any other non-null cursors of active controllers on the map.
A hook to customize the pitch angle of rotation for the current GestureEvent, relative to the start of the rotation. This function is only called in 3D. For 2D rotation, see getRotationAngle.
The default implementation changes the pitch based on the difference of the y coordinate of the drag event. It does this for both mouse drag events and touch two finger drag events.
The gestureEvent to determine the pitch angle for.
A hook to customize the angle of rotation for the current GestureEvent, relative to the start of the rotation. This function is only called in 2D. For 3D rotation, see getYawAngle and getPitchAngle.
For mouse drag events, the default implementation determines a rotation based on the angle of the mouse event relative to the center of the screen.
For touch rotate events, the default implementation determines a rotation based on the angle of the gesture event.
The gestureEvent to determine the rotation angle for.
A hook to determine the center of rotation. This point can be in view (pixel), a model or the map's reference.
The default implementation rotates around the point under the mouse/finger. Except for rotation with a mouse on 2D maps. There, rotation happens around the view center.
The gesture event to determine the rotation center for.
A hook that determines yaw angle of rotation for the current GestureEvent. This function is only called in 3D. For 2D rotation, see getRotationAngle.
For mouse drag events, the default implementation changes the yaw based on the difference of the x coordinate of the drag event. For touch rotate events, the default implementation changes the yaw based on the angle of the rotate event.
The gestureEvent to determine the yaw angle for.
Call this method to indicate that the controller's appearance has changed. Calling this method ensures the onDraw will be called during the next rendering pass.
A hook that determines if an event is a "rotate end" event.
For mouse, the default implementation returns true for mouse drag end events that have the right mouse button down, touch rotate end and two finger drag events.
The gesture event to check.
A hook that determines if an event is a rotate event.
Note that this should return true for all "rotate end" events, as well as "non-end" events.
For mouse, the default implementation returns true for mouse drag and "drag end" events with the right mouse button down. For touch, the default implementation returns true for rotate, two finger drag and "two finger drag end" events.
The gesture event to check.
Callback that is invoked when this controller is activated on a map. This method allows controller implementations to perform setup work.
the map on which the controller has been activated
Callback that is invoked when this controller is deactivated on a map. This method allows controller implementations to perform cleanup work. This method must return either any resolved value or a promise to indicate completion of deactivation. This allows controller implementation to perform asynchronous deactivation work. During the period between this method being called and the resolution of the deactivation promise, this controller will no longer receive input events, but will still get the opportunity to draw itself.
the map on which the controller has been deactivated
a concrete value to indicate immediate deactivation or a deactivation promise.
Callback that allows controller implementations to perform custom drawing on the map. Controller shapes and icons are drawn on top of all other content in the map. Note that the map may perform caching which may cause this method to only be invoked once. When a controller implementation's appearance changes the implementation should call invalidate on itself.
the GeoCanvas on which the controller can draw shapes.
Callback that allows controller implementations to draw labels on the map. Note that the map may perform caching which may cause this method to only be invoked once. When a controller implementation's appearance changes the implementation should call invalidate on itself.
the LabelCanvas on which the controller can draw labels.
Called when a gesture event has been received. This is not intended to be overridden by subclasses. You should override the hooks instead (isRotateEvent, isRotateEndEvent, getRotationCenter, getRotationAngle, getPitchAngle and getYawAngle).
The gesture event to handle
Called when a key event has been received. This method must return a HandleEventResult value to indicate if the event was handled or not, If this method returns EVENT_IGNORED, the map will be given the opportunity to perform default key event behaviour. If default event handling is not desired, this method should return EVENT_HANDLED. (See the Controller class description for the default behavior.)
The key event to be handled. Note that this is a KeyEvent and not a DOMEvent. You can access the corresponding DOMEvent through KeyEvent.domEvent.
The key event handling result.
An event indicating that this Controller has been activated. Activated means that the controller is active on the map, and the controller's onActivate has been called.
You can use this event to set up UI elements or other listeners related to the controller and the controller's map.
Optional
context: any2021.0
An event indicating that this Controller has been deactivated. Deactivated means that the controller has been removed from the map, and the controller's onDeactivate has been called.
You can use this event to clean up UI elements or other listeners related to the controller and the controller's map.
Optional
context: any2021.0
An event indicating that this Controller is invalidated. Invalidated means that the Controller requests for its onDraw to be called during the next rendering pass (because its appearance has changed). This event fires when invalidate is called.
Optional
context: any
Allows the user to rotate a map.
In a 2D view, the map is rotated around the center of the map. In 3D, the controller rotates around the point that is under the mouse or between the user's fingers.
In 2D, rotation is done by changing the camera's rotation. 3D rotation is done by changing the camera's yaw and pitch.
For a list of events handled by this controller, check isRotateEvent.
You can customize the controller by overriding its hooks:
See the Managing user input with LuciadRIA controllers tutorial for more information.
Since
2022.1