--- layout: api title: "v2.0.1 JavaScript Library: L.mapbox.template(template, data)" categories: api version: v2.0.1 permalink: /api/v2.0.1/l-mapbox-template ---
A mustache template rendering function, as used by the templating feature provided by L.mapbox.gridControl
.
Options | Value | Description |
---|---|---|
template | string | The template string |
data | object | Data you wish to pass into the template string |
Example:
var output = L.mapbox.template('Name: {% raw %}{{name}}{% endraw %}', {name: 'John'});
// output is "Name: John"