Zum Hauptinhalt gehen

Unique graphic for each point

Kommentare

4 Kommentare

  • Permanently deleted user
    Hi Bryan, 

     

    I'm not certain if this is there isn't an easier way out there, but I have seen numbered text renderers done like this before:

     

    Workflow sequence to create a renderer
    1. Add a new field to your featureset to hold your ordered numbers.  Eg. Add New ESRI.ArcGIS.Client.Field("LABEL", ESRI.ArcGIS.Client.Field.FieldType.String, "Label", Nothing, False, True, 0)
    2. Create a list to hold unique value renderer strings for each feature
    3. Loop through the features in your featureset
    4. Set the value of the field you created in step 1 to a count variable.
    5. Add String.Format(uniqueValueFormat, count) to the uniqueValueRenderers list.  uniqueValueFormat is a variable that contains the skeleton some renderer json "{{""value"":""{0}"",""label"":""{0}"",""description"":""{0}"",""symbol"":{{""type"":""esriTS"",""style"":""esriSLSDash"",""color"":[255,0,25,255],""xoffset"":10,""font"":{{""family"":""Arial"",""size"":12,""style"":""normal"",""weight"":""bold"",""decoration"":""none""}},""text"":""{0}""}}}}"
    6. Increase the counter
    7. Format the rest of the renderer json using String.Format(rendererJsonFormat, String.Join(",", uniqueValueRenderers.ToArray())).  rendererJsonFormat contains: "{{""type"":""uniqueValue"",""field1"":""LABEL"",""field2"":null,""field3"":null,""fieldDelimiter"":"", "",""uniqueValueInfos"":[{0}]}}"
    8. Use UpdateGraphicsLayer to display your featureset using the renderer json.  ESRI.ArcGIS.Client.Renderer.FromJson(rendererJson)
    You can use a second graphics layer to display another symbol with the text label if needed.

     

    Hope that helps!

     

    -Amanda
    0
  • Permanently deleted user
    Thanks Amanda. your solution works!
    0
  • Vipul Soni
    Hi,

     

    Please can you share the workflow.

     

    Thanks.
    0
  • Permanently deleted user
    Copy the text and use File > New > From Clipboard in Workflow Designer to open it.  This one is just a test, so it queries an arbitrary Airports layer from LA County.  You should be ok to delete or replace the QueryTask when you apply it to your own workflow/featureset.
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.