How to remove the labels rendered by UpdateGraphicsLayer
Hello,
I use Update Graphic Layer activity to label the selected features in my workflow, I give a Graphics Layer ID in this activity. I then tried to remove the labels using Remove Map Service with the same ID, but the labels won’t get removed. How to remove these labels?
Thanks
Feng
0
-
Hi Feng, use the activity "Update Graphic Layers" with same Graphics Layer ID and set the parameter "Remove all Features to True". That should work. 0 -
Thanks Srikanth,
I set "Remove all Features to True" to true, it doesn't work.0 -
should I setup something before I use "UpdateGraphicsLayer", or before I use "RemoveMapservice" ? 0 -
Is it possible for you to provide the workflow here or any screenshot to understand the problem clearly? 0 -
I figured it out. After I give the Graphics Layer ID an actually name (rather than a default variable), it works
Thank you Srikanth.0 -
I am currently trying to make something similar, I need to draw a label on the map, using UpdateGraphicsLayer (or similar). What did you create for the FeatureSet ?
I tried creating an ESRI.ArcGIS.Client.Symbols.TextSymbol , but i can't work out how to assign the X,Y and SpatialReference
0 -
I would like to know how you even got the render to work, I get an error saying "The calling thread cannot access this object becauyse a different thread owns it". I have used their input examples without altering and have tried using the JSON straight from ArcServer using the symbology of my choice but I get syntax and compiling ewrrors on the JSON using ESRI.ArcGIS.Client.Renderer.FromJson.
Can you show how you used this?0 -
here is what I did to draw a rectangle on my map:
1. Create a pPCPolyline = new ESRI.ArcGIS.Client.Geometry.PointCollection()
2. Add a "Add to collection <T>" activity in workflow sequence:
Field; Collection = pPCPolyline
Field; Item= new ESRI.ArcGIS.Client.Geometry.MapPoint(x,y,spatialReference1)
Field; TypeArgument = ESRI.ArcGIS.Client.Geomerty.MapPoint
// note that I got the x,y and spatialRef previously, from Map and point clicked - (just hard-code some values to try)
3. Repeat the "Add to collection <T>" activity several times to complete your polyline. ! you must turn around clockwise otherwise you endup with an Hour_glass instead of a rectangle.
4. Create a new myPolygon1 using an "assign" thing:
myPolygon1 = new ESRI.ArcGIS.Client.Geometry.Polygon()
5. Add another "Add to Collection<T> activity
In this activity, you will add your group of points inside one "ring" of your myPolygon1
Field; Collection = myPolygon1.Rings
Field; Item = pPCPolyline
Field; TypeArgument = ESRI.ArcGIS.Client.Geometry.PointCollection
6. Set WKID to your polygon : assign myPolygon1.StatialReference = spatialReference1 (*) I got that from getMapInfo.7. Create an activity called "update graphic Layer"
Field; Graphic Layer ID = "myGraphicLayer" (or use "Drawing")
Field; Remove all features : False
Field; FeatureSet = New ESRI.ArcGIS.Client.Tasks.FeatureSet(myPolygon1)
Field Renderer = New ESRI.ArcGIS.Client.SimpleRenderer With{ .Symbol = New ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol() With { .Fill = New System.Windows.Media.SolidColorBrush() With { .Color = System.Windows.Media.Color.FromArgb(255, 255, 255, 255) }, .BorderBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0)), .BorderThickness = 0 }}
_img_ alt="Draw Box" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f20000000SO8&feoid=Body&refid=0EMf2000000E40r"_/_img_
_img_ alt="graphic rendering" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f20000000SO8&feoid=Body&refid=0EMf2000000E40w"_/_img_I would do a better screen capture but the Workflow editor is SO NARROW that we can't see a single thing :) haha
0
Please sign in to leave a comment.
Comments
8 comments