Select to view content in your preferred language

SymbolDisplay not working correctly for more complex symbols

134
2
3 weeks ago
Labels (3)
ofirrosner
New Contributor III

When im using SimpleLineSymbol, SimpleFillSymbol,SimpleMarkerSymbol (or even when i create multilayer symbol from any combination of SoidStrokeLayer,SolidFillLayer) , SymbolDisplay  works just fine
But when im adding VectorMarkerSymbolLayer (Or reading from stylx file) ,SymbolDisplay  shows only the head(and sometimes not correctly) and does not show the polyline at all

For example(as cropped from the stylx symbol)

var layer1 = new SolidStrokeSymbolLayer(2.6, Color.Red)
{
    CapStyle = StrokeSymbolCapStyle.Butt,
    LineStyle3D = StrokeSymbolLayerLineStyle3D.Strip,
};

var layer2 = new VectorMarkerSymbolLayer(new List<VectorMarkerSymbolElement>()
{
    new VectorMarkerSymbolElement
        (
             new Polygon(new List<MapPoint>()
             {
                  new MapPoint(116.09, 0.29),
                  new MapPoint(-116.7, -137.69),
                  new MapPoint(-116.7, 137.699),
                  new MapPoint(116.09, 0.29),
             }, SpatialReferences.Wgs84),
         new MultilayerPolygonSymbol(new List<SymbolLayer>()
         {
              new SolidFillSymbolLayer(Color.Red),
              new SolidStrokeSymbolLayer()
              {
                  Color = Color.Red,
                  CapStyle = StrokeSymbolCapStyle.Round,
                  LineStyle3D = StrokeSymbolLayerLineStyle3D.Strip,
                  Width = 1 
              }
             })    
         ),
      })
      {
          Anchor = new SymbolAnchor(0.129,0, SymbolAnchorPlacementMode.Relative),
          Heading = 0,
          OffestX = 0,
          OffsetY = 0,
          Size = 33.3,         
      }​​


What im expecting => a line and head at in end(well because i dont have "Along the line publicly" available its a just the head repeating itself)
What im getting = > some junkey triangle (from the .stylex file is just the head w/o the line)

P.S1 
Tested both at 100.5.4 and 200.4 with the same result

P.S2 
I tried to do the following, which yields the same result(and it seems that's what SymbolDisplay is doing in it's core)

P.S3
here is the symbol im expecting to be show (as create at the .stylex file)

ofirrosner_0-1719818027870.png

 

Symbol = item.GetSymbolAsync(); //item the .stylx item from after reading the file to SymbolStylee
var swatch = await Symbol.CreateSwatchAsync()
SymbolImage = await swatch.ToImageSourceAsync() as BitmapSource; // SymbolImage  is a BitmapSource

 

 

0 Kudos
2 Replies
PreetiMaske
Esri Regular Contributor

I will try to reproduce this and let you know what I find. Is it possible to share symbol's json as in stylx file?

0 Kudos
ofirrosner
New Contributor III

Sadly i cannot share the stylx nor the json, but it very simple and easy to create (with ArcGis) symbol as you can see in the attached image
Also you have the symbol(well almost) coded 

0 Kudos