A navigation history control. This is a meta-control, that creates two dependent controls: previous and next. Call the trigger method on the previous and next controls to restore previous and next history states. The previous and next controls will become active when there are available states to restore and will become deactive when there are no states to restore.
ALKMaps. | A navigation history control. |
Properties | |
type | {String} Note that this control is not intended to be added directly to a control panel. |
previous | {ALKMaps.Control} A button type control whose trigger method restores the previous state managed by this control. |
previousOptions | {Object} Set this property on the options argument of the constructor to set optional properties on the previous control. |
next | {ALKMaps.Control} A button type control whose trigger method restores the next state managed by this control. |
nextOptions | {Object} Set this property on the options argument of the constructor to set optional properties on the next control. |
limit | {Integer} Optional limit on the number of history items to retain. |
autoActivate | {Boolean} Activate the control when it is added to a map. |
clearOnDeactivate | {Boolean} Clear the history when the control is deactivated. |
registry | {Object} An object with keys corresponding to event types. |
nextStack | {Array} Array of items in the history. |
previousStack | {Array} List of items in the history. |
listeners | {Object} An object containing properties corresponding to event types. |
restoring | {Boolean} Currently restoring a history state. |
Constructor | |
ALKMaps. | |
Functions | |
onPreviousChange | Called when the previous history stack changes. |
onNextChange | Called when the next history stack changes. |
destroy | Destroy the control. |
setMap | Set the map property for the control and previous and next child controls. |
draw | Called when the control is added to the map. |
previousTrigger | Restore the previous state. |
nextTrigger | Restore the next state. |
clear | Clear history. |
getState | Get the current state and return it. |
restore | Update the state with the given object. |
setListeners | Sets functions to be registered in the listeners object. |
activate | Activate the control. |
initStack | Called after the control is activated if the previous history stack is empty. |
deactivate | Deactivate the control. |
{ALKMaps.Control} A button type control whose trigger method restores the previous state managed by this control.
{Object} Set this property on the options argument of the constructor to set optional properties on the previous control.
{ALKMaps.Control} A button type control whose trigger method restores the next state managed by this control.
{Object} Set this property on the options argument of the constructor to set optional properties on the next control.
onPreviousChange: function( state, length )
Called when the previous history stack changes.
state | {Object} An object representing the state to be restored if previous is triggered again or null if no previous states remain. |
length | {Integer} The number of remaining previous states that can be restored. |
setMap: function( map )
Set the map property for the control and previous and next child controls.
map | {ALKMaps.Map} |
nextTrigger: function()
Restore the next state. If no items are in the next history stack, this has no effect. The next history stack is populated as states are restored from the previous history stack.
{Object} Item representing state that was restored. Undefined if no items are in the next history stack.
Called when the previous history stack changes.
onPreviousChange: function( state, length )
Called when the next history stack changes.
onNextChange: function( state, length )
Destroy the control.
destroy: function()
Set the map property for the control and previous and next child controls.
setMap: function( map )
Called when the control is added to the map.
draw: function()
Restore the previous state.
previousTrigger: function()
Restore the next state.
nextTrigger: function()
Clear history.
clear: function()
Get the current state and return it.
getState: function()
Update the state with the given object.
restore: function( state )
Sets functions to be registered in the listeners object.
setListeners: function()
Activate the control.
activate: function()
Called after the control is activated if the previous history stack is empty.
initStack: function()
Deactivate the control.
deactivate: function()