Nokia Maps API Reference

Contents

Class nokia.maps.map.component.panning.KineticMovement

Class Summary

This class represents the state of a kinetic movement as returned by the method startMovement() of nokia.maps.map.component.panning.Kinetic. A kinetic movement consists of two phases: move and slide. In the first, each move of the map is recorded (duration and direciton), in the second, the map has been released, but continues to move at a diminishing speed in the previously recorded direction until it stops.

Method Summary
addObserver (key, callback, [context]) : nokia.maps.util.OObject This method registers an observer for the property named by the caller.
attach (mapDisplay) This method will be invoked when the component is attached to a map and is not meant to be called directly.
destroy () This method is called from Display when Display is destroyed.
detach (mapDisplay) This method will be invoked when the component is detached from a map and is not meant to be called directly
get (key) : Variant This method retrieves the value of the property with the name provided by the caller.
getId () : String This method retrieves the unique identifier of the component.
remove (key) : nokia.maps.util.OObject This method removes the property with the name provided by the caller.
removeObserver (key, callback, context) : nokia.maps.util.OObject This method removes the observer for the property named by the caller.
set (nameOrObject, [value, [force]]) : nokia.maps.util.OObject This method sets property values, using the property names and values supplied by the caller.
Field Summary
Boolean aborted This property indicates if the given instance of KineticMovement has been aborted, so the slide phase did not occur or was not completed (true).
nokia.maps.util.Vector3D direction This property holds the current normalized direction vector in the movet and slide phases.
Boolean enabled This property is used by the owner kinetic component to enable or disable the given kinetic movement, because only one kinetic movement at a time can be ongoing.
Boolean finished This property indicates if the given instance of KineticMovement has finished (true) or not (false).
Number fps This property is provided for information only and represents the real rendered number of frames per second, which (in the best case) is epxected to be the same as the maxFps.
Number fraction This property represents the speed reduction of the map in the slide phase as percentage of the display diagonal per second.
Number fractionHz This property holds the frequency with which the value of fraction is applied to map movment speed in the slide phase.
Number frames This property acts as the frame counter.
nokia.maps.map.Display mapDisplay This property holds a reference to the map.Display instance to which the given component belongs.
Number maxFps This property holds the maximum frame frequency rate (frames per second) to be used in the slide phase.
Number maxSpeed This property holds the maximum speed of the sliding movement of the map used to calcuate the value of fraction.
Number minSpeed This property holds the minimum speed of the sliding movement of the map used to calcuate the value of fraction.
Boolean movementPhase This property indicates if the given instance of KineticMovement is in the move phase (true) or not (false).
nokia.maps.map.component.panning.Kinetic owner This property holds a reference to the kinetic component that is the owner of the given KineticMovement.
Boolean slidingPhase This property indicates if the given instance of KineticMovement is in the slide phase (true) or not (false).
Number speed This property holds the current speed in pixels per second in the move and slide phases.
Number stopSpeed This property indicates the slowest permissible map movement speed in the slide phase in pixels per second.
Field Detail
Boolean aborted
This property indicates if the given instance of KineticMovement has been aborted, so the slide phase did not occur or was not completed (true). If the kinetic movement has not been aborted, the property holds the value of false.
This property holds the current normalized direction vector in the movet and slide phases.
Boolean enabled
This property is used by the owner kinetic component to enable or disable the given kinetic movement, because only one kinetic movement at a time can be ongoing.

It is possible to observe this property to detect if a movement is disabled by another one. You can re-enable the movement by setting the property nokia.maps.map.component.panning.Kinetic#current back to it, but be aware that endless recursion may result if another component attempts to this at the same time.

Another possibility is to observe the current property of the owning kinetic component when a kinetic movement is disabled and attempt to recover the desired kinetic movement as soon as current becomes null.

Boolean finished
This property indicates if the given instance of KineticMovement has finished (true) or not (false).
Number fps
This property is provided for information only and represents the real rendered number of frames per second, which (in the best case) is epxected to be the same as the maxFps.
Number fraction
This property represents the speed reduction of the map in the slide phase as percentage of the display diagonal per second. This means that a value of 0 causes an endless slide, while a value of 1.0 should stop the map within one second. However, because the fraction is not applied only once per second, it is not linear and the effect of the fraction is stronger in the early stages of the slide phase but weaker later. In reality, it is the value of 3.0 (the default) that stops the map within approximately a second. As a side-effect, the property stopSpeed is relatively unimportant.
Number fractionHz
This property holds the frequency with which the value of fraction is applied to map movment speed in the slide phase. By default, this occurs 15 times per second (15 Hz). The lower the value of fraction, the more linear the frequency and the less smooth the deceleration, conversely, the higher the fraction value, the more realistic the sliding movement. However, a frame rate below the fraction frequency leads to a jerky sliding movement. The higher the fraction frequency, the smaller the fraction effect, so reducing the fraction frequency parallel a reduction in the value of fraction itself.
Number frames
This property acts as the frame counter. Whenever a new frame for the slide phase is rendered, the value of this property is incremented. The property is helpful when monitoring the frame frequency (fps). For example, you might wish to observe this property and log its value to the console on every 10th or 20th call.
Number maxFps
This property holds the maximum frame frequency rate (frames per second) to be used in the slide phase. The value helps reduce CPU usage, as even on the most powerful devices a rate of more then 100 frames per second has no noticeable effect.
Number maxSpeed
This property holds the maximum speed of the sliding movement of the map used to calcuate the value of fraction. Note that the property has no effect to the real movement speed of the map.

Note that to modify maxSpeed, you must first overload the method updateSpeedLimits(), which updates maxSpeed in every frame.

Number minSpeed
This property holds the minimum speed of the sliding movement of the map used to calcuate the value of fraction. Note that the property has no effect to the real movement speed of the map.

Note that to modify minSpeed, you must first overload the method updateSpeedLimits(), which updates minSpeed in every frame.

Boolean movementPhase
This property indicates if the given instance of KineticMovement is in the move phase (true) or not (false).
This property holds a reference to the kinetic component that is the owner of the given KineticMovement.
Boolean slidingPhase
This property indicates if the given instance of KineticMovement is in the slide phase (true) or not (false).
Number speed
This property holds the current speed in pixels per second in the move and slide phases.
Number stopSpeed
This property indicates the slowest permissible map movement speed in the slide phase in pixels per second. The map movement is stopped as soon as its speed equals or becomes lower than the value of this property. This is necessary, because the formula used to reduce the map movement speed does not guarantee the speed to reach zero. The value of this property must not be set to zero.

Note that to modify stopSpeed you must first overload the method updateSpeedLimits(), which updates stopSpeed in every frame.

Documentation generated on Wed Jun 27 2012 16:54:25 GMT+0200 (CEST).