Skip to content

Commit

Permalink
clarify documentation, close Leaflet#36
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Oct 26, 2015
1 parent 3d01934 commit e64b46d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ additionally clustering points into a grid for performance.
## Basic Usage

```js
var heat = L.heatLayer(latlngs, {radius: 25}).addTo(map);
var heat = L.heatLayer([
[50.5, 30.5, 0.2], // lat, lng, intensity
[50.6, 30.4, 0.5],
...
], {radius: 25}).addTo(map);
```

To include the plugin, just use `leaflet-heat.js` from the `dist` folder:
Expand All @@ -33,7 +37,7 @@ To build the dist files run:

#### L.heatLayer(latlngs, options)

Constructs a heatmap layer given an array of `LatLng` points and an object with the following options:
Constructs a heatmap layer given an array of points and an object with the following options:
- **minOpacity** - the minimum opacity the heat will start at
- **maxZoom** - zoom level where the points reach maximum intensity (as intensity scales with zoom),
equals `maxZoom` of the map by default
Expand All @@ -42,7 +46,12 @@ Constructs a heatmap layer given an array of `LatLng` points and an object with
- **blur** - amount of blur, `15` by default
- **gradient** - color gradient config, e.g. `{0.4: 'blue', 0.65: 'lime', 1: 'red'}`

Each point in the input array can be either an array like `[50.5, 30.5, 0.5]`,
or a [Leaflet LatLng object](http://leafletjs.com/reference.html#latlng).

Optional third argument in each `LatLng` point (`altitude`) represents point intensity.
Unless `max` option is specified, intensity should range between `0.0` and `1.0`.


#### Methods

Expand Down

0 comments on commit e64b46d

Please sign in to comment.