Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public HeatMap(HeatPointList heatPoints, HeatmapSettings settings, Bounds bounds)
 {
     Settings = settings;
     HeatPoints = heatPoints;
     Bounds = bounds;
 }
Exemplo n.º 5
0
 public HeatMap(HeatPointList heatPoints, HeatmapSettings settings)
 {
     Settings = settings;
     HeatPoints = heatPoints;
 }
Exemplo n.º 6
0
 public SettingsCacheObject(HeatmapSettings settings, HeatPointList heatPoints)
 {
     Settings = settings;
     HeatPoints = heatPoints;
 }