- Legend to Symbols

-
Class ovi.mapsapi.map.component.panning.Kinetic
The kinetic component will add kinetic panning possibilities to the display. If being added to a display certain
other component will automatically detect that and use the kinetic panning, e.g. the panning.Click, panning.Tap
and panning.Drag components.
A kinetic panning persists out of two phases, the movement and the sliding phase. Within the first phase the map
is moved, these movements and their timings are recorded so that the kinetic panning module knows how fast the
map is currently moving and into which direction. Within the second phase, the sliding phase, the kinetic component
will simulate what happens when the map is released while moving into the recorded direction with the recorded
speed (pixel per second), so the map will run after as if a pysical map would have been dragged and then suddenly
released.
It is possible to use the kinetic panning as well from other components. Because it must be avoided that two
kinetic pannings are running at the same time, the component implements mechanisms to ensures that only one kinetic
panning at a time is performed. Example of how a kinetic panning shall be done:
// Query for the kinetic component.
var kineticComponent = display.getComponentById("panning.Kinetic");
// Initialize the kinetic engine to record a new movement, it directly
// starts within the movement phase.
var kineticMovement = kineticComponent.startMovement();
// Move the map, if the last parameter is omitted no movement will occurr
// (simulation mode), the kinetic panning component will just recognize it
// for the sliding phase calculations.
kineticMovement.moveBy(10, 10, true);
//...
// Finish the recording and release the map, which will cause the
// sliding phase to start. You can't reuse a kinetic movement, therefore
// after calling "endMovement" all further calls to moveBy will be
// ignored.
kineticMovement.endMovement();
// From now on the map will slide until stop at the kinetic movement
// is called or the map speed reduced to zero due to the fraction.
kineticMovement.addObserver(
"finished",
function(kineticMovement, key, value, oldValue) {
if (value===true)
alert("kinetic movement "+(this.aborted?"was aborted":"finished successfully")+"!");
},
this
);
The kinetic component will add kinetic panning possibilities to the display. If being added to a display certain
other component will automatically detect that and use the kinetic panning, e.g. the panning.Click, panning.Tap
and panning.Drag components.
A kinetic panning persists out of two phases, the movement and the sliding phase. Within the first phase the map
is moved, these movements and their timings are recorded so that the kinetic panning module knows how fast the
map is currently moving and into which direction. Within the second phase, the sliding phase, the kinetic component
will simulate what happens when the map is released while moving into the recorded direction with the recorded
speed (pixel per second), so the map will run after as if a pysical map would have been dragged and then suddenly
released.
It is possible to use the kinetic panning as well from other components. Because it must be avoided that two
kinetic pannings are running at the same time, the component implements mechanisms to ensures that only one kinetic
panning at a time is performed. Example of how a kinetic panning shall be done:
// Query for the kinetic component.
var kineticComponent = display.getComponentById("panning.Kinetic");
// Initialize the kinetic engine to record a new movement, it directly
// starts within the movement phase.
var kineticMovement = kineticComponent.startMovement();
// Move the map, if the last parameter is omitted no movement will occurr
// (simulation mode), the kinetic panning component will just recognize it
// for the sliding phase calculations.
kineticMovement.moveBy(10, 10, true);
//...
// Finish the recording and release the map, which will cause the
// sliding phase to start. You can't reuse a kinetic movement, therefore
// after calling "endMovement" all further calls to moveBy will be
// ignored.
kineticMovement.endMovement();
// From now on the map will slide until stop at the kinetic movement
// is called or the map speed reduced to zero due to the fraction.
kineticMovement.addObserver(
"finished",
function(kineticMovement, key, value, oldValue) {
if (value===true)
alert("kinetic movement "+(this.aborted?"was aborted":"finished successfully")+"!");
},
this
);
| {ovi.mapsapi.map.component.panning.KineticMovement} | The new kinetic movement. |
// Create a new kinetic movement
var kineticPanning = display.getComponentById("panning.Kinetic"),
kineticMovement;
if (kineticPanning) {
kineticMovement = kineticPanning.startMovement();
// ...
}