added more info
This commit is contained in:
parent
a935bfc93e
commit
e6c9f03e3d
24
doc/API.md
24
doc/API.md
@ -107,26 +107,28 @@ torqueLayer.setSQL("SELECT * FROM table LIMIT 100");
|
|||||||
### Events
|
### Events
|
||||||
Events in Torque follow the format:
|
Events in Torque follow the format:
|
||||||
```js
|
```js
|
||||||
torqueLayer.on('event-type', function() {
|
torqueLayer.on('event-type', function([callback_obj]) {
|
||||||
// do something
|
// do something
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
| Events | options | callback object | Description |
|
| Events | callback object | Description |
|
||||||
|-----------|:-----------|:----------|:---------------------------------------|
|
|-----------|:----------|:---------------------------------------|
|
||||||
| ```change:steps```| | current step | When a map changes steps, this event is triggered |
|
| ```change:steps```| current step | When a map changes steps, this event is triggered |
|
||||||
| ```change:bounds```| | current bounds | ?? |
|
| ```change:bounds```| current bounds | ?? |
|
||||||
| ```change:time```| | current time, step number | When a map changes time, this event is triggered |
|
| ```change:time```| current time, step number | When a map changes time, this event is triggered |
|
||||||
| ```pause```| none | ?? | Pauses the animation at current time and step |
|
| ```play```| none?? | Triggered when the Torque layer is played |
|
||||||
| ```stop```| none | ?? | Stops the animation, returns the time and step to the beginning |
|
| ```pause```| none?? | Triggered when the Torque layer is paused |
|
||||||
| ```play```| none | ?? | Plays the animation from the current time and step |
|
| ```stop```| none?? | Triggered when the Torque layer is stopped |
|
||||||
|
| ```load```| none?? | Triggered when the Torque layer is loaded |
|
||||||
|
|
||||||
##### SQL Example
|
##### SQL Example
|
||||||
|
|
||||||
Limit the data used in the Torque map.
|
Limit the data used in the Torque map.
|
||||||
```js
|
```js
|
||||||
torqueLayer.on('change:steps', function() {
|
torqueLayer.on('change:steps', function(step) {
|
||||||
|
// do something with step
|
||||||
|
console.log("Current step is " + step);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user