Hello,
I'm trying to display the grid label (coordinates) of a MapFrame on the right side of the map, but can't figure out how to do this. At the moment they are on the left side. I'ld like to do this in my code...
I've found the indices for position on the element:
Grid position indexes. Coordinates on the left side (I want them on the right side)
And my code:
var gridLabelsNorthSouth = new CIMGridLine
{
Name = "Labels",
ElementType = GridElementType.Label,
GridLineOrientation = GridLineOrientation.NorthSouth,
Pattern = new CIMGridPattern { Interval = this.printOptions.KoordinatenGitter, Start = 1, Stop = 0, Gap = 0 },
VisibleIndices = new int[] { 3, 4 }, // <-- This is not working
FromTick = new CIMExteriorTick
{
Length = 0.0694,
Offset = 0,
IsVisible = true,
EdgeAffinity = new int[] { 3, 4 }, // <-- This is not working
GridEndpoint = new CIMGridEndpoint
{
GridLabelTemplate = new CIMSimpleGridLabelTemplate
{
// DynamicStringTemplate = $"<dyn type=\"grid\" units=\"{gridUnits}\" decimalPlaces=\"0\" separator=\"True\" showDirections=\"False\" showZeroMinutes=\"False\" showZeroSeconds=\"False\"/>",
DynamicStringTemplate = $"<dyn type=\"grid\" decimalPlaces=\"0\" separator=\"True\" showDirections=\"False\" showZeroMinutes=\"False\" showZeroSeconds=\"False\"/>",
Symbol = (SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 8, "Arial", "Regular")).MakeSymbolReference()
},
Offset = 0.083,
Position = 4, // <-- This is not working
LineSelection = 7
}
},
ToTick = new CIMExteriorTick
{
Length = 0.0694,
Offset = 0,
IsVisible = true,
EdgeAffinity = new int[] { 3, 4 }, // <-- This is not working
GridEndpoint = new CIMGridEndpoint
{
GridLabelTemplate = new CIMSimpleGridLabelTemplate
{
DynamicStringTemplate = "", //TODO
Symbol = (SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 0.5, "Arial", "Regular")).MakeSymbolReference()
},
Offset = 0.083,
Position = 4, // <-- This is not working
LineSelection = 7
}
}
};
var projectedCoordinateSystem = mapframe.Map.SpatialReference.ToCIMSpatialReference() as ProjectedCoordinateSystem;
CIMMapGrid mapGrid = new CIMMeasuredGrid
{
Name = "GEODAT-Tools_MapGrid",
GridLines = new CIMGridLine[] { gridLinesEastWest, gridLinesNorthSouth, gridLabelsEastWest, gridLabelsNorthSouth },
IsVisible = true,
ProjectedCoordinateSystem = projectedCoordinateSystem,
};
var mapFrameDefinition = mapframe.GetDefinition();
CIMMapFrame cimMapFrame = mapFrameDefinition as CIMMapFrame;
cimMapFrame.Grids = new CIMMapGrid[] { mapGrid };
mapframe.SetDefinition(mapFrameDefinition);
Any advice ?
Thanks !