public void Setup() { _points = new HeatPointList(); _points.Add(new HeatPoint(39, -104)); _points.Add(new HeatPoint(38, -105)); _points.Add(new HeatPoint(-10, -100)); _points.Add(new HeatPoint(-10, 100)); _points.Add(new HeatPoint(10, -100)); }
protected void Page_Load(object sender, EventArgs e) { HeatmapSettings settings; try { if (!string.IsNullOrEmpty(Request.QueryString["token"])) { Guid token = new Guid(Request.QueryString["token"]); settings = HeatmapSettingsCache.Instance.Retrieve(token).Settings; } else { double smallestX = 0, smallestY = 0, largestX = 0, largestY = 0; int largestRange = 0; int multiplier = 10; var HeatPoints = new HeatPointList(); string[] dataPoints = Request.QueryString["data"].Split(new char[] { ',' }); // create the heatpoints from for (int i = 0; i < dataPoints.Length; i++) { double lat = double.Parse(dataPoints[i]); double lon = double.Parse(dataPoints[++i]); HeatPoints.Add(new HeatPoint(lat, lon, HeatmapSettings.DEFAULT_INTENSITY)); } settings = new HeatmapSettings(); settings.Size = MapQueryStringValueToHeatMapPropertyValue("size", settings.Size); settings.Sensitivity = MapQueryStringValueToHeatMapPropertyValue("sensitivity", settings.Sensitivity); settings.Transparency = MapQueryStringValueToHeatMapPropertyValue("transparency", settings.Transparency); settings.Zoom = MapQueryStringValueToHeatMapPropertyValue("zoom", settings.Zoom); } //var hm = new HeatMap(settings); throw new NotImplementedException("not implemented"); //Respond(hm.GenerateMap()); } catch (Exception ex) { Bitmap b = new Bitmap(100, 100); Graphics Surface = Graphics.FromImage(b); Surface.Clear(Color.Black); Surface.DrawImage(b, 100, 100); Respond(b); } }
public Tile(HeatPointList heatPoints, HeatmapSettings settings, Bounds bounds) { Bounds = bounds; Bounds heatMapBounds = new Bounds(bounds); heatMapBounds.TopLeftLat += settings.Size / 2 * this.DegreesPerPixelLat; heatMapBounds.TopLeftLng -= settings.Size / 2 * this.DegreesPerPixelLng; heatMapBounds.BottomRightLat -= settings.Size / 2 * this.DegreesPerPixelLat; heatMapBounds.BottomRightLng += settings.Size / 2 * this.DegreesPerPixelLng; HeatPointList pointsWithinBounds = new HeatPointList(); foreach (HeatPoint hp in heatPoints) { if (heatMapBounds.Contains(hp)) pointsWithinBounds.Add(hp); } HeatMap = new HeatMap(pointsWithinBounds, settings, heatMapBounds); }