applied minor edits to getting started section, based on our style guide
This commit is contained in:
parent
6638a13e14
commit
27e3480130
@ -1,6 +1,6 @@
|
||||
##Getting started
|
||||
##Getting Started
|
||||
|
||||
Although the most straightforward way to use Torque is through either the CartoDB editor, or by passing the layer's viz.json to [CartoDB.js](http://docs.cartodb.com/cartodb-platform/cartodb-js/getting-started/), many use cases work best with the standalone [Torque.js](https://github.com/CartoDB/torque/tree/master/dist). Assuming you have a public dataset with a `date` column, it's really simple to create an animated map with the library. First you need to have a Leaflet map prepared in an HTML page:
|
||||
Although the most straightforward way to use Torque is through either the CartoDB Editor, or by passing the layer's viz.json to [CartoDB.js](http://docs.cartodb.com/cartodb-platform/cartodb-js/getting-started/), many use cases work best with the standalone [Torque.js](https://github.com/CartoDB/torque/tree/master/dist). Assuming you have a public dataset with a `date` column, it is really simple to create an animated map with the library. First, you need to have a Leaflet map prepared in an HTML page:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
|
||||
@ -21,7 +21,7 @@ Although the most straightforward way to use Torque is through either the CartoD
|
||||
</body>
|
||||
```
|
||||
|
||||
For Torque to work with your table you only need a username, the name of the table, and a CartoCSS string to style the map. Leaflet's method `addTo` will add the torque layer to the map. `play` runs the animation with the options specified in the CartoCSS properties
|
||||
For Torque to work with your table, you only need a username, the name of the table, and a CartoCSS string to style the map. Leaflet's method `addTo` adds the Torque layer to the map. `play` runs the animation with the options specified in the CartoCSS properties.
|
||||
|
||||
```html
|
||||
<script>
|
||||
@ -51,7 +51,7 @@ For Torque to work with your table you only need a username, the name of the tab
|
||||
</script>
|
||||
```
|
||||
|
||||
You can use any kind of tile source outside CartoDB, just by specifying the location of a [valid TileJSON](https://github.com/mapbox/tilejson-spec) file:
|
||||
You can use any kind of tile source outside CartoDB, by specifying the location of a [valid TileJSON](https://github.com/mapbox/tilejson-spec) file:
|
||||
|
||||
```javascript
|
||||
var torqueLayer = new L.TorqueLayer({
|
||||
@ -71,9 +71,9 @@ Optionally, it is also possible to use a custom SQL query for your visualization
|
||||
});
|
||||
```
|
||||
|
||||
Like in a video player, you can use animation control methods such as `play`, `stop` and `pause` at any point. Torque's animator fires a `change:time` event each time the animation "ticks" to the next frame, and there are a number of properties and methods that can be run during playback, which are detailed in the [API documentation](../torque_api.md). At any point, for example, the styling of the layer's markers can be changed using the `layer.setCartoCSS('##style##')`.
|
||||
Like in a video player, you can use animation control methods such as `play`, `stop` and `pause` at any point. Torque's animator fires a `change:time` event each time the animation "ticks" to the next frame, and there are a number of properties and methods that can be run during playback, which are detailed in the [API documentation](/cartodb-platform/torque/torqueapi/). At any point, for example, the styling of the layer's markers can be changed using the `layer.setCartoCSS('##style##')`.
|
||||
|
||||
##Usage examples
|
||||
##Usage Examples
|
||||
The best way to start learning about the library is by taking a look at some of the examples below:
|
||||
|
||||
* A basic example using the WWI British Navy dataset - ([view live](http://cartodb.github.io/torque/examples/navy_leaflet.html) / [source code](https://github.com/CartoDB/torque/blob/master/examples/navy_leaflet.html))
|
||||
|
Loading…
Reference in New Issue
Block a user