This is a migrated thread and some comments may be shown as answers.

Hotspots of different colors

1 Answer 73 Views
Map
This is a migrated thread and some comments may be shown as answers.
Bradley
Top achievements
Rank 1
Bradley asked on 27 Dec 2010, 07:56 PM
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?

1 Answer, 1 is accepted

Sort by
0
Bradley
Top achievements
Rank 1
answered on 28 Dec 2010, 12:54 AM
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...
Tags
Map
Asked by
Bradley
Top achievements
Rank 1
Answers by
Bradley
Top achievements
Rank 1
Share this question
or