Issue 1: We created symbology with Status and DeActivated IDC status and hosted this as a map service in ArcGIS Server Manager1. Here are the values for the combination of two fields: 1,<Null>;5,<Null>;30,<Null>,1,N;5,N;30,N
When I am trying to render the layer in 4.x, layer is unable to render 1,<Null> with the blue line and applying the default symbol (<all other values>) i.e. black line.
So I created renderer object using UniqueValueRenderer replacing "1,<Null>" with "1, " and assigned to the Feature layer and it worked.
I wish this layer to load without renderer object in the coming later versions.
Issue 2:
After resolving issue1 with renderer object, I am facing issue with the symbology in the legend widget. Please refer the screenshot showing difference between two frameworks for the same layer.
Both frameworks are using same map service hosted in 10.2 ArcGIS Server Manager.
3.x 4.x
Here is the symbology of the conduit layer in the mxd document. For example, for In Service (blue) symbol, there are six values with the combination of two fields Status and DeactivatedIDC.
4.x is showing duplicate symbol in the legend widget where as the 3.x version showing unique symbols similar to the mxd below.
I would like to generate same output in 3.x and 4.x. Please suggest.
Thanks
Srikanth Dasari
Solved! Go to Solution.
The legend will display each value you have listed in the uniqueValueInfos array as individual items so you need to find a way to group those similar items into one. I don't know how you are doing it in your code to change the Nulls to 1, but using a valueExpression in the render, you can created a filter to group the items into one. For example (untested on this dataset):
var renderer = {
type: "unique-value", // autocasts as new UniqueValueRenderer()
valueExpression: "When($feature.Status == 1 && IsEmpty($feature.DeActivated_IDC), 'In Service', $feature.Status == 5 && IsEmpty($feature.DeActivated_IDC), 'In Service', $feature.Status == 5 && IsEmpty($feature.DeActivated_IDC), 'In Service', 'other')",
defaultSymbol: { type: "simple-marker" }, // autocasts as new SimpleFillSymbol()
uniqueValueInfos: [{
// All features with value of "In Service" will be blue
value: "In Service",
symbol: {
type: "simple-line",
color: "blue"
}
}],
The legend will display each value you have listed in the uniqueValueInfos array as individual items so you need to find a way to group those similar items into one. I don't know how you are doing it in your code to change the Nulls to 1, but using a valueExpression in the render, you can created a filter to group the items into one. For example (untested on this dataset):
var renderer = {
type: "unique-value", // autocasts as new UniqueValueRenderer()
valueExpression: "When($feature.Status == 1 && IsEmpty($feature.DeActivated_IDC), 'In Service', $feature.Status == 5 && IsEmpty($feature.DeActivated_IDC), 'In Service', $feature.Status == 5 && IsEmpty($feature.DeActivated_IDC), 'In Service', 'other')",
defaultSymbol: { type: "simple-marker" }, // autocasts as new SimpleFillSymbol()
uniqueValueInfos: [{
// All features with value of "In Service" will be blue
value: "In Service",
symbol: {
type: "simple-line",
color: "blue"
}
}],
Thank you @Anonymous User