AnsweredAssumed Answered

Having Consistency issues creating PictureMarkerSymbols

Question asked by TerryCoe on Apr 10, 2019
Latest reply on Apr 12, 2019 by TerryCoe

I am working in a WPF client application with the ArcGISRuntime version of 100.1. currently i am experiencing an issue getting my PictureMarkerSymbol to render consistently when there are more than 5 or 6 items on my map vector tile base map. I am combining it with a text marker symbol, to create a composite symbol on the map, and the test symbol portion will always render. 

 

I have passed a list of items to this code snippet one at a time to create the symbols. Please let me know if i need to post more code or you have any questions.

 

public static async Task<Symbol> CreateSymbols(string text, SymbolTypes type, SymbolShapes shape)
{
   var iconPath = string.Empty;
   iconPath = string.Format(@"pack://application:,,,/Images/{0}_{1}.png", type.ToString(), shape.ToString());
   var icon = new Uri(iconPath, UriKind.RelativeOrAbsolute);
   var pc = new PictureMarkerSymbol(icon);
   pc.Width = 30;
   pc.Height = 30;

   var cm = new CompositeSymbol();
   var ts = new TextSymbol()
   {
      Color = Colors.Black,
      FontStyle = FontStyle.Normal,
      FontDecoration = FontDecoration.None,
      FontFamily = "Arial",
      FontWeight = FontWeight.Bold,
      Size = 14,
      VerticalAlignment = VerticalAlignment.Middle,
      HorizontalAlignment = HorizontalAlignment.Center,
      OffsetY = shape == SymbolShapes.Arrow ? 5 : 0
   };

   ts.Text = text;
   cm.Symbols.Add(pc);
   cm.Symbols.Add(ts);

   return await Task.Factory.StartNew<Symbol>(() => { return cm; });
}

Attachments

Outcomes