OpenLayers extension for HeatCanvas

Mon 06 June 2011
  • ANN tags:
  • heatcanvas
  • javascript
  • OpenStreetMap
  • project published: true comments: true

As the screenshot shows, now you can embed HeatCanavs in your OpenLayers application, as well as OpenSteetMap.

Three steps to create such kind of map:

1. Create HeatCanvas layer:
[cc lang="javascript"]
// constructor params:
// name, OpenLayers map instance, OpenLayers layer options, HeatCanvas options
var heatmap = new OpenLayers.Layer.HeatCanvas("HeatCanvas", map, {},
{'step':0.3, 'degree':HeatCanvas.QUAD, 'opacity':0.8});
[/cc]

2. Feed some data on layer:
[cc lang="javascript"]
heatmap.pushData(latitude, longitude, value);
[/cc]

3. Add layer to map:
[cc lang="javascript"]
map.addLayer(heatmap);
[/cc]

The live demo is hosted on github: http://sunng87.github.com/heatcanvas/openstreetmap.html

HeatCanavs is a heat map implementation on HTML5 canvas and WebWorker API.