Select to view content in your preferred language

Text Symbol - backgroundColor and borderLineColor

3566
3
03-09-2011 08:59 AM
HeathClark
New Contributor III
I am creating markers (Symbol and Text) dynamically thru c# serverside code (Page Load event) to display various points of interest.  The code works great to show a custom symbol and text at a specific x,y coordinate.

However, the TextSymbol does not honor  backgroundColor or borderLineColor using the JSON Syntax

{
  "type" : "esriTS",
  "color" : <color>,
  "backgroundColor" : <color>,
  "borderLineColor" : <color>,
  "verticalAlignment" : "<baseline | top | middle | bottom>",
  "horizontalAlignment" : "<left | right | center | justify>",
  "rightToLeft" : <true | false>,
  "angle" : <angle>,
  "xoffset" : <xoffset>,
  "yoffset" : <yoffset>,
  "kerning" : <true | false>,
  "font" : {
    "family" : "<fontFamily>",
    "size" : <fontSize>,
    "style" : "<italic | normal | oblique>",
    "weight" : "<bold | bolder | lighter | normal>",
    "decoration" : "<line-through | underline | none>"
  }
}

(code from http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/index.html?symbol.html)

Are the backgroundColor and borderLineColor valid options when creating TextSymbols (type esriTS) from serverside code pushed to a graphics layer?  If so, why doesn't the following correctly display a white background, red border with text in the middle?

{
     "type": "esriTS",
     "text": "TEST TEXT",
     "color": [255,255,255,255],
     "backgroundColor": [0,0,0,255],
     "borderLineColor": [255,0,0,255],
     "verticalAlignment": "bottom",
     "horizontalAlignment": "left",
     "rightToLeft": false,
     "angle": 0,
     "xoffset": 0,
     "yoffset": 0,
     "font": {
      "family": "Arial",
      "size": 12,
      "style": "normal",
      "weight": "bold",
      "decoration": "none"
 }
}
0 Kudos
3 Replies
Kathleen_Crombez
Occasional Contributor III
your colors are not valid.
RGB colors do allow for a fourth value that represents transparency, however this value should be between 0.0 and 1.0.

for example... [255,255,255,1.0]
0 Kudos
Hernando_CountyProperty_Apprai
New Contributor III
Did you ever get an answer to this?  I am also having this same problem where the background color and the border line color don't seem to be honored.
0 Kudos
KyleDixon
Occasional Contributor
I'm also looking for an answer. Anyone find out?
0 Kudos