Select to view content in your preferred language

ESRI.ArcGIS.Client.AdvancedSymbology.ProcessMessage crashes the application

1750
1
06-18-2014 01:55 PM
Labels (1)
C4iC4i
by
New Contributor
Steps to Reproduce:
1. Create a message with sic that ends with L--- and LabelRules 434 in the mil2525c esri database's SymbolInfo table (e.g. WO-DMCD----L---).
2. Process the message using ESRI.ArcGIS.Client.AdvancedSymbology.ProcessMessage(message)

Expected Result:
- message is processed

Actual Result:
- Application crashes

Additional Notes:
- Only symbols ending with L--- and with LabelRules 434 has this issue. Other symbols can be processed without issue.
- ArcGIS 10.2

Code Snip:
NOTE: this code snip comes from https://developers.arcgis.com/net/desktop/api-reference/html/M_Esri_ArcGISRuntime_Layers_MessageLaye...
The only difference is that I've changed the sic and spacial reference.
__________________________________________
using ESRI.ArcGIS.Client.AdvancedSymbology;

MessageLayer layer = new MessageLayer();
layer.SymbolDictionaryType = ESRI.ArcGIS.Client.AdvancedSymbology.SymbolDictionaryType.Mil2525C;
Message message = MessageHelper.CreateMilitaryUpdateMessage("MyStringIdentifier", "position_report", new List<MapPoint> {
new MapPoint(3.22, 53.9) }, new Dictionary<string, string>()
{
    { "sic", "WO-DMCD----L---" }
},
new SpatialReference(102100));
layer.ProcessMessage(message);
0 Kudos
1 Reply
MichaelBranscomb
Esri Frequent Contributor
Hi,

Have you checked the geometry type expected for this symbol? The sample unfortunately only caters for point, line, polygon but there are some more complex geometric arrangements in approx 5% of symbol cases.

In the sample code for the Symbol Dictionary Search you will see the code checks the geometry control type which is available in the collection of Values (http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client~ESRI.ArcGIS.Cli...).

Below is a snippet from the sample which caters for approx 95% of cases. The remaining 5% are more complex shapes requiring additional control points. However, we are reviewing how we can simplify this in the API.

Dictionary<string, string> values = (Dictionary<string, string>)Symbol.Values;
string geometryControlType = values["GeometryConversionType"];
_draw.DrawComplete += _draw_DrawComplete;
            switch (geometryControlType)
            {
                case "Point":
                    _draw.DrawMode = DrawMode.Point;
                    break;
                case "Polyline":
                    _draw.DrawMode = DrawMode.Polyline;

                    break;
                case "Polygon":
                    _draw.DrawMode = DrawMode.Polygon;
                    break;
                case "Circle":
                    _draw.DrawMode = DrawMode.Circle;
                    break;
                case "Rectangular":
                    _draw.DrawMode = DrawMode.Rectangle;
                    break;
            }
            _draw.IsEnabled = (_draw.DrawMode != DrawMode.None);


Cheers

Mike
0 Kudos