Hi,
any sample code for using CIMGridLine with GridElementType.Corner?
I am trying to modify the code given here
https://community.esri.com/message/888447-re-how-to-add-cimgraticule-into-mapframe-object?commentID=..., but keep crashing as I am not sure which properties are required or how exactly VisibleIndices is used (if at all?).
Thanks.
Solved:
GridElementType.Corner needs to be used in conjunction with CIMGraticule.IsAutoScaled = true.
If CIMGridPattern Interval = 0 then the coordinates will show at the exact corners. If this has a value the coordinates will show at the closest auto scaled tick to the corner.
So edit code from above to include:
var gridLabelsNorthSouth = new CIMGridLine
{
Name = "Corner Label",
ElementType = GridElementType.Corner,
GridLineOrientation = GridLineOrientation.NorthSouth,
Pattern = new CIMGridPattern { Interval = 0, Start = 0, Stop = 1, Gap = 0 },
etc.....
}
var mapGrid = new CIMGraticule
{
Name = "Graticule",
IsVisible = true,
IsAutoScaled = true,
etc....
}
Solved! Go to Solution.
Solved:
GridElementType.Corner needs to be used in conjunction with CIMGraticule.IsAutoScaled = true.
If CIMGridPattern Interval = 0 then the coordinates will show at the exact corners. If this has a value the coordinates will show at the closest auto scaled tick to the corner.
So edit code from above to include:
var gridLabelsNorthSouth = new CIMGridLine
{
Name = "Corner Label",
ElementType = GridElementType.Corner,
GridLineOrientation = GridLineOrientation.NorthSouth,
Pattern = new CIMGridPattern { Interval = 0, Start = 0, Stop = 1, Gap = 0 },
etc.....
}
var mapGrid = new CIMGraticule
{
Name = "Graticule",
IsVisible = true,
IsAutoScaled = true,
etc....
}
Solved:
GridElementType.Corner needs to be used in conjunction with CIMGraticule.IsAutoScaled = true.
If CIMGridPattern Interval = 0 then the coordinates will show at the exact corners. If this has a value the coordinates will show at the closest auto scaled tick to the corner.
So edit code from above to include:
var gridLabelsNorthSouth = new CIMGridLine
{
Name = "Corner Label",
ElementType = GridElementType.Corner,
GridLineOrientation = GridLineOrientation.NorthSouth,
Pattern = new CIMGridPattern { Interval = 0, Start = 0, Stop = 1, Gap = 0 },
etc.....
}
var mapGrid = new CIMGraticule
{
Name = "Graticule",
IsVisible = true,
IsAutoScaled = true,
etc....
}