I've got 2 MultilayerPointSymbols that I extracted from CIM Json. I want to merge the 2 symbols together so that the actSymbol is on top of the mapMarkerSymbol and the actSymbol has a Y offset so that it's pushed up a bit (that way it'll fit better).. But I don't see anyway to give it a yoffset?
In the picture below, you can see the motorcycle and the EyeDrop symbol. I want to push the motorcyle up a bit.
Code and Image Follows:
Solved! Go to Solution.
Hello Karen,
Thank you for your query.
To adjust the vertical position of the motorcycle symbol, you can modify the VectorMarkerSymbolLayer's OffsetY property before adding it to the combined symbol. Here's how to modify your code:
IList<SymbolLayer> newSymbolLayers = new List<SymbolLayer>();
foreach (SymbolLayer lyr in mapMarkerSymbol.SymbolLayers)
{
newSymbolLayers.Add(lyr); //VectorMarkerSymbolLayer,
}
foreach (SymbolLayer lyr in actSym.SymbolLayers)
{
if (lyr is VectorMarkerSymbolLayer vectorLayer)
{
vectorLayer.OffsetY = 5; // Adjust Y offset to move the motorcycle up
}
newSymbolLayers.Add(lyr);
}
var finalSym = new MultilayerPointSymbol(newSymbolLayers);
The key change is checking if each layer is a VectorMarkerSymbolLayer and setting its OffsetY property. You can adjust the value of 5 up or down to fine-tune the positioning of the motorcycle symbol. A positive value moves it up, while a negative value would move it down.
Let me know if this clarifies your situation.
Hello Karen,
Thank you for your query.
To adjust the vertical position of the motorcycle symbol, you can modify the VectorMarkerSymbolLayer's OffsetY property before adding it to the combined symbol. Here's how to modify your code:
IList<SymbolLayer> newSymbolLayers = new List<SymbolLayer>();
foreach (SymbolLayer lyr in mapMarkerSymbol.SymbolLayers)
{
newSymbolLayers.Add(lyr); //VectorMarkerSymbolLayer,
}
foreach (SymbolLayer lyr in actSym.SymbolLayers)
{
if (lyr is VectorMarkerSymbolLayer vectorLayer)
{
vectorLayer.OffsetY = 5; // Adjust Y offset to move the motorcycle up
}
newSymbolLayers.Add(lyr);
}
var finalSym = new MultilayerPointSymbol(newSymbolLayers);
The key change is checking if each layer is a VectorMarkerSymbolLayer and setting its OffsetY property. You can adjust the value of 5 up or down to fine-tune the positioning of the motorcycle symbol. A positive value moves it up, while a negative value would move it down.
Let me know if this clarifies your situation.
That was it. Thank you.