Hotspots of different colors

2 posts, 0 answers
  1. Bradley
    Bradley avatar
    4 posts
    Member since:
    Aug 2010

    Posted 27 Dec 2010 Link to this post

    I'm trying to create a hotspot (information layer item) that can be one of several colors based on something in the data.  I modified the MapItem class used as an example in the Telerik tutorial for the RadMap map as follows and bound the hotspot's template colors to them. Basicaly what I get is something like last one to set it wins, which I don't exactly want... The relevant part of the MapItem class is shown below:

    Any ideas?  Thanks in advance for any and all assistance and guidance in this matter.

    public MapItem(string caption, Location location, double baseZoomLevel, ZoomRange zoomRange, int id, int siteTypeId)
          {
             this.Caption = caption;
             this.Location = location;
             this.BaseZoomLevel = baseZoomLevel;
             this.ZoomRange = zoomRange;
      
             this.Id = id;
      
             switch (siteTypeId)
             {
                case -1: //Current site
                   this.HotSpotBackgroundMain = Color.FromArgb(255, 0, 152, 217);
                   this.HotSpotBackgroundLight = Color.FromArgb(255, 170, 213, 232);
                   this.HotSpotBackgroundDark = Color.FromArgb(255, 0, 129, 184);
                   break;
                case 1:
                   this.HotSpotBackgroundMain = Colors.Red;
                   this.HotSpotBackgroundLight = Colors.Magenta;
                   this.HotSpotBackgroundDark = Colors.Brown;
                   break;
                case 4:
                   this.HotSpotBackgroundMain = Colors.Orange;
                   this.HotSpotBackgroundLight = Colors.Yellow;
                   this.HotSpotBackgroundDark = Colors.Brown;
                   break;
                case 5:
                   this.HotSpotBackgroundMain = Colors.Yellow;
                   this.HotSpotBackgroundLight = Colors.Yellow;
                   this.HotSpotBackgroundDark = Colors.Yellow;
                   break;
                default:
                   break;
             }
          }
      
          public string Caption
          {
             get;
             set;
          }
      
          public int Id
          {
             get;
             set;
          }
      
          public Location Location
          {
             get;
             set;
          }
          public double BaseZoomLevel
          {
             get;
             set;
          }
          public ZoomRange ZoomRange
          {
             get;
             set;
          }
      
          public Color HotSpotBackgroundMain
          {
             get;
             set;
          }
      
          public Color HotSpotBackgroundLight
          {
             get;
             set;
          }
      
          public Color HotSpotBackgroundDark
          {
             get;
             set;
          }

    Edit: Upon further investigation the "Colorizer" might be what I have to use somehow. Is this correct?
  2. Bradley
    Bradley avatar
    4 posts
    Member since:
    Aug 2010

    Posted 27 Dec 2010 Link to this post

    Ok, looks like it was working fine I was just getting hot spots ontop of my first hot spot due to a few of the locations I was mapping were in the same location.  I feel silly now...
  3. DevCraft banner
Back to Top