new StateManager(ngeoLocation, ngeoUsedKeyRegexp)
Provides a service for managing the application state. The application state is written to both the URL and the local storage.
Parameters:
Name | Type | Description |
---|---|---|
ngeoLocation |
!ngeo.Location | ngeo location service. |
ngeoUsedKeyRegexp |
!Array. | regexp used to identify the used keys. |
Members
(non-null) initialState: Object:.<string:, string:>
Object representing the application's initial state.
(non-null) ngeoLocation: ngeo.Location
(non-null) usedKeyRegexp: Array:.<!RegExp:>
useLocalStorage: boolean
Methods
deleteParam(key)
Delete a parameter
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Key. |
getInitialBooleanValue(key)
Get the state value for key
.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | State key. |
Returns:
boolean|undefined
State value.
getInitialNumberValue(key)
Get the state value for key
.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | State key. |
Returns:
number|undefined
State value.
getInitialStringValue(key)
Get the state value for key
.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | State key. |
Returns:
string|undefined
State value.
getInitialValue(key)
Get the state value for key
.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | State key. |
Returns:
string|undefined
State value.
updateState(object)
Update the application state with the values in object
.
Parameters:
Name | Type | Description |
---|---|---|
object |
!Object. |
Object. |