source: src/openlayers_heatmap/script/heatmap-webworker.js@ 9006

Last change on this file since 9006 was 8966, checked in by dennisw, 14 years ago

openlayers_heatmap - toegevoegd, voorbeeld met standaard data

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision
  • Property svn:mime-type set to text/plain
File size: 1.0 KB
RevLine 
[8966]1/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
2 * license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
3 * full text of the license. */
4
5/**
6 * This script is called as web worker from HeatMap.createAsync().
7 */
8
9onmessage = function(event) {
10 var options = event.data;
11
12 importScripts("heatmap.js");
13
14 // start the coloring
15 colorize(options);
16
17 // send the result image data back to the main script
18 var result = {
19 status: "done",
20 imageData: options.imageData
21 };
22 postMessage(result);
23
24 // important: now terminate the worker, because some browser (Chrome 6)
25 // only allow a limited number of workers
26 close();
27};
28
29var colorize = function(options) {
30 var handlerProgress = function(event) {
31 postMessage({
32 status: "progress",
33 progress: event.progress
34 });
35 };
36
37 HeatMap.colorizeIntensityMask(options.imageData, options.parameters.colorMap, handlerProgress);
38};
Note: See TracBrowser for help on using the repository browser.