Select to view content in your preferred language

Unable to update the VectorMarkerSymbolLayer component Size of a MultiLayerLine SymbolLayer

350
1
Jump to solution
05-22-2024 07:12 AM
Labels (3)
AdamStewart1
New Contributor

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;

 

 

 

1 Solution

Accepted Solutions
AdamStewart1
New Contributor

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;
			}
		}
	}

 

 

View solution in original post

1 Reply
AdamStewart1
New Contributor

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;
			}
		}
	}