views:

597

answers:

2

I want to creata a heatmap (density map) on images. The examples like the one in http://www.heatmapapi.com/Sample%5FGoogle.aspx are good examples of what I try to do.

Is there a GWT way of achieving this? Or any good (flash or js) solution you can suggest (other then the ones mentioned http://stackoverflow.com/questions/357721/heatmap-tools)?

A: 

As far as I know there is nothing in GWT that is designed to do heatmaps, at least not in the official SDK. I'd say the quickest thing for you would be to integrate an existing JS solution as a native function and use it from your current GWT code.

Iker Jimenez
is there any js solution you suggest? (or used before)
dkberktas
I'm sorry but I've never had to implement a heatmap before. Go for whatever JS library you can use, get it working in a dummy HTML page before and then wrap all the methods you need to use into GWT JSNI methods.
Iker Jimenez
You can find the JSNI documentation here http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideJavaScriptNativeInterface
Iker Jimenez
+1  A: 

I implemented something similar for my final year university project. I used the same approach as HeatMap API, overlaying a generated image on the map when it is repositioned.

I wrote a custom Java web server accepting the bounding box co-ordinates in the querystring to produce a semi-transparent PNG image that looked somewhat like a heat-map, but it was by no means a proper statistically correct algorithm. At the time I wasn't able to find any algorithms for creating the heatmap and many of the algorithms found online or in journals were actually for cluster heat-maps/tree-maps rather than density heatmaps.

I generated a 2D array for the data, using a function to map each co-ordinate with a value. Adding to the array increased the values, so the array needed to be normalised to a value between 0-255, which can then be easily colored and output onto a canvas. I'm afraid I can't find the source code for this, and the algorithm was very approximate.

A year or so ago when the members list of the BNP (racist British political party) was leaked I came across another (simpler, but probably even less accurate) solution that placed a PNG heat spot at each pin point, creating the effect of a heat-map. There is a screenshot of this here, although I can't find the original map http://www.labourlist.org/revealed%5Fthe%5Fbnps%5Fsocial%5Fmedia%5Fstrategy%5Fmark%5Fhanson

Alex
Currently I developed sth similar but this is not the exact result I want, but thanks for the insight
dkberktas