map.action.Single
Extends IMapAction.
Simple map movement. The movement is made immediately after it is passed to map.action.Manager.
Constructor | Fields | Events | Methods
Constructor
map.action.Single(tick)
Creates a simple (single step) map movement.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: Object Movement parameters. |
— |
Type: Function Function that will be called after performing the action. Accepts an error or null as a parameter, if the action was not successful. |
|
— |
Type: Number[] The new map center in geo coordinates. |
|
false |
Type: Boolean Flag showing whether the new map zoom needs to be checked. If the flag is set to true, the range of allowable zoom levels at the new point will be requested before performing the action. If the specified zoom does not fall within the allowable values, it will be corrected. In addition, the value of the new map center in global pixel coordinates will be changed. |
|
0 |
Type: Number Duration of making the move, in milliseconds. |
|
— |
Type: Number[] The new map center in global pixels. When the "center" and "globalPixelCenter" parameters are set simultaneously, the "center" parameter is ignored. |
|
'linear' |
Type: String Timing function. |
|
— |
Type: Number The new map zoom. |
* Mandatory parameter/option.
Example:
var myCallback = function(err) {
if (err) {
throw err;
}
},
myAction = new ymaps.map.action.Single({
center: [0, 0],
zoom: 4,
duration: 1000,
timingFunction: 'ease-in',
checkZoomRange: true,
callback: myCallback
});
// The action is performed immediately after calling "execute".
myMap.action.execute(myAction);
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
Events
Name |
Description |
Event that notifies the map that movement has finished. Inherited from IMapAction. |
|
Event that notifies the map of the next step. Contains the fields:
Inherited from IMapAction. |
Methods
Name |
Returns |
Description |
Starts the movement to be performed by the map. This method is called automatically by the map movement manager. From the moment when IMapAction.begin is called, the movement manager listens for IMapAction.event:tick and IMapAction.event:end and executes them. Inherited from IMapAction. |
||
end() |
Stops movement. Inherited from IMapAction. |
|
isActive() |
Boolean |
Checks whether map movement is being performed at this moment. |
Methods details
isActive
{Boolean} isActive()
Checks whether map movement is being performed at this moment.
Returns true if the movement is currently being performed by the map, otherwise false.
Mandatory parameter/option.