I have advanced symbology styling from a mobilestyle stylx file which works great for the most part.
I cannot seem to modify the .Size property of the VectorMarkerSymbolLayer (think line markers from a symbol style). Width works on the polyline component, size works for plain Markers on their own, width works for polygons. Color works, locking and unlocking on all possible components.
Size on this one layer type is the only property I've found that when modifying has no apparent effect. The base size is 13.333 and no matter what I do programmatically, it is always rendered at the same size.
foreach (var symbolLayer in multilayerLineSymbol.SymbolLayers)
{
if( symbolLayer is Esri.ArcGISRuntime.Symbology.SolidStrokeSymbolLayer solidStrokeSymbolLayer )
{
solidStrokeSymbolLayer.Width = solidStrokeSymbolLayer.Width * sizeRatio;
}
if (symbolLayer is Esri.ArcGISRuntime.Symbology.VectorMarkerSymbolLayer vectorMarkerSymbolLayer)
{
//doesn't work
//vectorMarkerSymbolLayer.Size = vectorMarkerSymbolLayer.Size * symbolRatio * sizeRatio * 10;
//still does nothing
vectorMarkerSymbolLayer.Size = 80;
}
if (symbolLayer.IsColorLocked)
{
symbolLayer.IsColorLocked = false;
multilayerLineSymbol.Color = backColor;
symbolLayer.IsColorLocked = true;
}
else
{
}
}
multilayerLineSymbol.Color = foreColor;
Solved! Go to Solution.
Nevermind, I figured it out.
~DenverCoder9
Just kidding. Editing the size of the marker layer has no effect, you have to edit the map point symbol elements that make up the vector marker symbol.
if (symbolLayer is Esri.ArcGISRuntime.Symbology.VectorMarkerSymbolLayer vectorMarkerSymbolLayer)
{
foreach( var element in vectorMarkerSymbolLayer.VectorMarkerSymbolElements )
{
if( element.Symbol is MultilayerPointSymbol elementPointSymbol )
{
elementPointSymbol.Size *= sizeRatio;
}
}
}
Nevermind, I figured it out.
~DenverCoder9
Just kidding. Editing the size of the marker layer has no effect, you have to edit the map point symbol elements that make up the vector marker symbol.
if (symbolLayer is Esri.ArcGISRuntime.Symbology.VectorMarkerSymbolLayer vectorMarkerSymbolLayer)
{
foreach( var element in vectorMarkerSymbolLayer.VectorMarkerSymbolElements )
{
if( element.Symbol is MultilayerPointSymbol elementPointSymbol )
{
elementPointSymbol.Size *= sizeRatio;
}
}
}