POST
|
I have a feature layer with 500 unique values in the UniqueValueRenderer. It's supposed to only have 2 because 499 of them are identical. How do I programmatically remove duplicate symbols from the renderer? More details: I have a Graphics Layer that I want converted to Feature Layer. The new feature layer needs a UniqueValueRenderer. My graphics layer for example has 499 identical symbols and one other symbol. I need a UVR that will have only 2 values + DefaultSymbol Right now, I have successfully created the desired feature layer out of the graphics layer, but I see 500 Symbols in the TOC control, which I had no choice but to add add to the UVR. As I am adding new values to the UVR while going through the graphics container of the graphics layer, I tried checking that specific symbol already exists in the UVR, but it kept coming back saying I don't even though I know for a fact it does. I can see in the debugger that coming in symbol's characterists are identical to the one that already exists in UVR but the .Equals always came back False. So, yes, I ended up makeing 500 unique values when I only wanted (should've needed) 2. Sample Code: IElement element = graphicsLayerGC.Next(); ILineSymbol passedInSymbol = (element as ILineElement).Symbol; string rendVal = UVRend.Value[0]; ILineSymbol rendSymbol = UVRend.Symbol[rendVal] as ILineSymbol; //find out if duplicate if(passedInSymbol.Equals(rendSymbol)) { //This statement should be true, but never is. } I am only able to see if passedInSymbol's and rendSymbol's characteristics are identical while using "Watch" during debugging. If I hover on these two while debugging all I can see is this for both. I wanted to see things like Color, Width, etc. Any help will be appreciated. Thanks!
... View more
08-19-2020
12:26 PM
|
0
|
1
|
450
|
POST
|
Hello, Were you ever able to resolve this issue? I know it's a very old post but any help will be appreciated. Thanks, Sukhjit
... View more
09-18-2017
06:25 AM
|
0
|
0
|
199
|
POST
|
Hi Sandhya! Thanks a lot for your reply. I figured out the solution shortly after my post 🙂 I came back to post the solution in case somebody else was struggling with the same issue and realized that you've replied to me already. Here's what I did to solve my issue: ITrackCancel myCancelTracker = new CancelTrackerClass(); myCancelTracker.CancelOnClick = true; myCancelTracker.CancelOnKeyPress = true; Both TrackCancelClass and CancelTrackerClass implement ITrackCancel but TrackCancelClass can only be used in Server Context. I needed to use CancelTrackerClass since I wanted to interrupt redrawing features on the map on click or on any key press. It's so confusing since these two classes are named in such a similar way. I just wish esri people would've named them a little nicer so that I could tell a difference by just looking at the name. Just try not to reset the TrackCancel object before setting its CancelOnClick property. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004200000235000000 ITrackCancel.Reset: "Resets the manager after the associated operation is finished." "The Reset method should be called just before a process that may be cancelled, such as a lengthy operation, begins. The Reset method sets the state of the CancelTracker to uncancelled and returns the internal counter, which is used to update the Progressor to zero." See this example code where it doesn't implement the 'Reset' method: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/00010000001w000000.htm Let me know if it doesn't help.
... View more
06-20-2011
06:47 AM
|
0
|
0
|
367
|
POST
|
Hi, Here's what I am trying to do: ITrackCancel myTrackCancel = new TrackCancelClass(); myTrackCancel.Reset(); //no problem here myTrackCancel.CancelOnClick = false; // I get a System.NotImplementedException here The exception message is "The method or operation is not implemented". Has anybody experienced this before? Do I need to do anything to the myTrackCancel beforehand so I can set those bool values? Thank You, Sukhjit
... View more
06-16-2011
09:06 AM
|
0
|
2
|
673
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|