Today I will explain how Azure web role can be used with Bing Maps to draw Heat map based on the input file. The input file data is as follows –
I have state name of USA, latitude and longitude, number of units sold of a product (typical sales data) in the particular state sorted in ascending order.
Now let’s create a web role. I will have my input file added in the web role. In the page load I will read input text file and plot heat map.
Add a page in the project named as BingHeatMap.aspx and copy paste the code mentioned here on aspx and code behind side. Don’t forget to replace string YourBing Map Key with key of your windows live account.
So my solution structure is as follows –
Now download and install Mozilla latest version. The HTML 5 canvas element is supported in IE9 (and above) and latest version of Mozilla. I don’t have IE9 therefore here I am using Mozilla.
Run the project. Final heat map plotted as shown below –
From the diagram it is apparent that, California, Florida and Vermont region has less number of sales so these regions are in red and somewhat yellow in Heat Map. Whereas Washington and Colorado has maximum number of sales so these regions are in Green on Heat Map. If you drilldown (zoom in on the map), the color difference becomes more vivid as shown below –