Maps API for JavaScript Developer's Guide

H.map.IControl

Interface Summary

This interface defines methods used for direct view or camera manipulation.

[ For full details, see the Interface Details ]

Method Summary

Table 1. Methods
Methods

startControl (opt_kinetics, opt_atX, opt_atY)

This method starts control action for a camera. It makes it possible to control camera animation and movement according to the values provided through the the method H.map.IControl#control.

control (moveX, moveY, moveZ, angleX, angleY, angleZ, zoom, opt_timestamp)

This method triggers single control action on engine. This will trigger an animation which will start modification of the view's or camera's properties according to values begin set. Modification will occur at every frame. The speed values are measure by 'levels per frame' were 1 level cooresponds to a distance to next zoom level.

endControl (opt_preventKinetics, opt_adjustView)

This method ends the current control action, stopping the ongoing animation triggered by the startControl() method. The method can prevent kinetics as well as adjust the final view if it receives an adjust function.

Interface Description

This interface defines methods used for direct view or camera manipulation.

Method Details

startControl (opt_kinetics, opt_atX, opt_atY)

This method starts control action for a camera. It makes it possible to control camera animation and movement according to the values provided through the the method H.map.IControl#control.

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, angleX, angleY, angleZ, zoom, opt_timestamp)

This method triggers single control action on engine. This will trigger an animation which will start modification of the view's or camera's properties according to values begin set. Modification will occur at every frame. The speed values are measure by 'levels per frame' were 1 level cooresponds to a distance to next zoom level.

Parameters:
 
moveX:
{number}
 
moves the view/cam in right/left direction
moveY:
{number}
 
moves the view/cam in bottom/top direction
moveZ:
{number}
 
moves the view/cam in depth direction (changes zoom level)
angleX:
{number}
 
A value indicating the angle of rotation around the x-axis as degrees per second
angleY:
{number}
 
A value indicating the angle of rotation around the y-axis as degrees per second
angleZ:
{number}
 
A value indicating the angle of rotation around the z-axis as degrees per second
zoom:
{number}
 
changes current zoom level (for view works as moveZ)
opt_timestamp:
{number=} [optional]
 

endControl (opt_preventKinetics, opt_adjustView)

This method ends the current control action, stopping the ongoing animation triggered by the startControl() method. The method can prevent kinetics as well as adjust the final view if it receives an adjust function.

Example

//prevent kinetcs
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]
 
A value indicating whether to prevent kinetics animation true or not false
opt_adjustView:
{function(H.map.ViewModel.CameraData)=} [optional]
 
user defined function which can adjust the final view this function takes last requestedData from the view model and should return a modified H.map.ViewModel.CameraData which will be set as the final view