Maps API for JavaScript Developer's Guide

H.map.IControl

Interface Summary

This interface defines methods used for direct view manipulation.

[ For full details, see the Interface Details ]

Method Summary

Table 1. Methods
Methods

startControl (opt_kinetics, opt_atX, opt_atY)

To start the controlling of the look-at-point animation. After this method was invoked, the look-at-point animation can be controlled by several calls of H.map.IControl.prototype.control and finished by a call of H.map.IControl.prototype.endControl

control (moveX, moveY, moveZ, rotateX, rotateY, rotateZ)

To control a look-at-point animation in screen space. Before the look-at-point can be controlled the method H.map.IControl.prototype.startControl must be invoked once. The animation can be finished via H.map.IControl.prototype.endControl

endControl (opt_preventKinetics, opt_adjustView)

To finish the control of a look-at-point animation. See also H.map.IControl.prototype.startControl and H.map.IControl.prototype.control

Interface Description

This interface defines methods used for direct view manipulation.

Method Details

startControl (opt_kinetics, opt_atX, opt_atY)

To start the controlling of the look-at-point animation. After this method was invoked, the look-at-point animation can be controlled by several calls of H.map.IControl.prototype.control and finished by a call of H.map.IControl.prototype.endControl

Parameters:
 
opt_kinetics:
{H.util.kinetics.IKinetics=} [optional]
 
Kinetics settings
opt_atX:
{number=} [optional]
 
The x screen coordinate at which control starts
opt_atY:
{number=} [optional]
 
The y screen coordinate at which control starts

control (moveX, moveY, moveZ, rotateX, rotateY, rotateZ)

To control a look-at-point animation in screen space. Before the look-at-point can be controlled the method H.map.IControl.prototype.startControl must be invoked once. The animation can be finished via H.map.IControl.prototype.endControl

Parameters:
 
moveX:
{number}
 
The movement along the x-axis in pixels per second
moveY:
{number}
 
The movement along the y-axis in pixels per second
moveZ:
{number}
 
The movement along the z-axis in zoom-levels per second
rotateX:
{number}
 
The rotation around the x-axis in degrees per second
rotateY:
{number}
 
The rotation around the y-axis in degrees per second
rotateZ:
{number}
 
The rotation around the z-axis in degrees per second

endControl (opt_preventKinetics, opt_adjustView)

To finish the control of a look-at-point animation. See also H.map.IControl.prototype.startControl and H.map.IControl.prototype.control

Example

//prevent kinetics
viewModel.endControl(true);

//prevent kinetics and set adjusted view
viewModel.endControl(true, function(requested) {
  requested.zoom = Math.round(requested.zoom);
});
Parameters:
 
opt_preventKinetics:
{boolean=} [optional]
 
Indicates whether a kinetic effect at the end of the controlled animation is prevented.
opt_adjustView:
{function(H.map.ViewModel.ILookAtData)=} [optional]
 
A custom function to adjust the final view. It receives the last requested look-at data from the view model and has to return a possibly modified H.map.ViewModel.ILookAtData which is used instead.