Create your own heat maps using HeatMapAPI. Use it over the Internet or as a .NET DLL to run in your environment. Integrate heat map images into Google Maps or other GIS systems.
Google Example with .NET

The following is an example of how to use our API with Google Maps using Microsoft .NET. This example passes in the name of a table found in a SQL Server database located in our server. We call a specific URL that uses .NET server-side code to get back the image then using our helper API loads it into the Google Map. We now have an update for Google Maps V3.

Our examples show how to integrate our API with Google maps, however you can use whatever GIS system you choose. If you choose to use Google, you should obtain your own license for Google maps if required per the Google Terms of Use. A free or paid license for HeatMapAPI doesn't include any license for Google Maps. Google Maps is not required, our API works with other GIS systems too, this is just an example.

This table has over 7,000 rows to represent this traffic.

Step 1 - Link Scripts
<script src="javascript/HeatmapAPI.aspx?k=d975a671-4a29-44bc-9ee1-6e1b281f52bb" type="text/javascript"></script>

<script src="http://maps.google.com/maps?file=api&v=2&key=(YOUR GOOGLE KEY HERE)" type="text/javascript"></script>

<script src="javascript/HeatmapAPIGoogle.js" type="text/javascript"></script>


Step 2 - Load Google and Init Heat Maps API
<script type="text/javascript">
function loadGoogle()
{
 if (GBrowserIsCompatible())
 {
  m = new GMap2(document.getElementById("map"));
  m.addControl(new GLargeMapControl());
  m.addControl(new GMapTypeControl());
  m.setCenter(new GLatLng(39, -94.75), 11);
  initHeatmap();
 }
 else
  alert('Your Internet browser is not compatible
    with this website.');
}

setTimeout('loadGoogle()', 1);

function initHeatmap()
{
  var myHM = new GEOHeatmap();
  myHM.Init(400, 300); // Step 1
  myHM.UseURL('SampleHMReturnImage.aspx?k=0'); // Step 2
  var preUrl = myHM.GetURL();
  var heatmapOverlay = new HMGoogleOverlay(preUrl);
  m.addOverlay(heatmapOverlay);
}

The Example:

Feel free too zoom around to see how it works.
Step 3 - Get Image
Response.Buffer = true;
Response.Expires = -1;
Response.ContentType = "image/png";

double lat1 = Convert.ToDouble(Request["lat1"]);
double lat2 = Convert.ToDouble(Request["lat2"]);
double lon1 = Convert.ToDouble(Request["lon1"]);
double lon2 = Convert.ToDouble(Request["lon2"]);

GenericDataAccess d = new GenericDataAccess(System.Configuration.ConfigurationManager.ConnectionStrings["mydatabase"].ToString());
string sql = "SELECT [" + "Latitude" + "], [" + "Longitude" + "], [" + "Traffic1" + "] FROM [" + "Kansas_Traffic" + "]";
sql += " WHERE Latitude Between " + lat2 + " AND " + lat1;
sql += " AND Longitude Between " + lon1 + " AND " + lon2;

GEOHeatMap.Heatmap hm = new GEOHeatMap.Heatmap(Convert.ToInt16(Request["w"]), Convert.ToInt16(Request["h"]), lat1, lat2, lon1, lon2, 2, 0);
DataSet ds = d.GetData(sql); // Call to your DB here

hm.SetDataFromDataSet(ref ds);
ds.Dispose();

Bitmap bmp = hm.Render();
System.IO.MemoryStream imageStream = new System.IO.MemoryStream();
bmp.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
long len = imageStream.Length;
Byte[] imageBytes = new Byte[len + 1];
imageStream.Position = 0;
int totalRead = imageStream.Read(imageBytes, 0, (int)len);

Response.BinaryWrite(imageBytes);

imageStream.Close();
bmp.Dispose();


    Copyright 2008-2011, HeatMapAPI / Geospatial Analytics Inc.