Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add point editing styles to GeometryEditor demo #72

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/GeometryEditor/MyGeometryEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class MyGeometryEditor : GeometryEditor
VertexSymbol = null,
SelectedVertexSymbol = null,
SelectedMidVertexSymbol = null,
FeedbackVertexSymbol = null
FeedbackVertexSymbol = null,
VertexTextSymbol = null
}
};
private VertexTool _rotateTool = new VertexTool()
Expand Down Expand Up @@ -108,7 +109,9 @@ public class MyGeometryEditor : GeometryEditor
VertexSymbol = null,
SelectedVertexSymbol = null,
SelectedMidVertexSymbol = null,
FeedbackVertexSymbol = null, BoundingBoxSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.Cyan, 2)
FeedbackVertexSymbol = null,
BoundingBoxSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.Cyan, 2),
VertexTextSymbol = null
}
};
#endregion
Expand Down Expand Up @@ -140,14 +143,17 @@ public void Initialize(Geometry geometry, Symbol? symbol)
if (geometry is Polygon)
{
_vertexTool.Style.FillSymbol = _rotateTool.Style.FillSymbol = _moveTool.Style.FillSymbol = _inactiveTool.Style.FillSymbol = symbol;
_inactiveTool.Style.SelectedVertexSymbol = _inactiveTool.Style.VertexSymbol = _moveTool.Style.SelectedVertexSymbol = _moveTool.Style.VertexSymbol = null;
}
else if (geometry is Polyline)
{
_vertexTool.Style.LineSymbol = _rotateTool.Style.LineSymbol = _moveTool.Style.LineSymbol = symbol;
_inactiveTool.Style.LineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Cyan, 2);
_inactiveTool.Style.SelectedVertexSymbol = _inactiveTool.Style.VertexSymbol = _moveTool.Style.SelectedVertexSymbol = _moveTool.Style.VertexSymbol = null;
}
else if (geometry is MapPoint || geometry is Multipoint)
{
_inactiveTool.Style.VertexSymbol = _inactiveTool.Style.SelectedVertexSymbol = _moveTool.Style.SelectedVertexSymbol = _moveTool.Style.VertexSymbol = symbol;
}
}
Start(geometry);
Expand Down