Namespace TimeMap.state
- Defined in:
- state.js
- See:
- State Example
Namespace for static state functions used to set the timemap state programmatically, either in a script or from the url hash.
Static Methods
Method | |
---|---|
TimeMap.state.fromUrl()
Get the state parameters from the URL, returning as a config object
|
|
TimeMap.state.setConfig(config, state)
Set state settings on a config object for TimeMap.init()
|
|
TimeMap.state.setConfigFromUrl(config)
Set state settings on a config object for TimeMap.init() using
parameters in the URL.
|
|
TimeMap.state.toParamString(state)
Make a parameter string from a state object
|
|
TimeMap.state.toUrl(state)
Make a full URL from a state object
|
Static Method Details
TimeMap.state.fromUrl()
:{Object}
Get the state parameters from the URL, returning as a config object
- Returns:
- {Object} Object with state config settings
TimeMap.state.setConfig(config, state)
Set state settings on a config object for TimeMap.init()
Parameters (optional) | ||
---|---|---|
config | {Object} | Config object for TimeMap.init(), modified in place |
state | {Object} | Object with state config settings |
- See:
- TimeMap.init
TimeMap.state.setConfigFromUrl(config)
Set state settings on a config object for TimeMap.init() using
parameters in the URL. Note that as of Timemap.js v.1.6, this
will run automatically if state functions are present.
// set up the config object var config = { // various settings, as usual for TimeMap.init() }; // get state settings from the URL, e.g.: // http://www.example.com/mytimemap.html#zoom=4&selected=1 TimeMap.state.setConfigFromUrl(config); // initialize TimeMap object var tm = TimeMap.init(config);
Parameters (optional) | ||
---|---|---|
config | {Object} | Config object for TimeMap.init() |
- See:
- TimeMap.init
TimeMap.state.toParamString(state)
:{String}
Make a parameter string from a state object
Parameters (optional) | ||
---|---|---|
state | {Object} | Object with state config settings |
- Returns:
- {String} Parameter string in URL param format
TimeMap.state.toUrl(state)
:{String}
Make a full URL from a state object
Parameters (optional) | ||
---|---|---|
state | {Object} | Object with state config settings |
- Returns:
- {String} Full URL with parameters
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)