I have a few queries and would appreciate your guidance:
Overview:
I'm using the Geometry Editor to draw polygons and polylines for waypoints, which is working as expected. Additionally, I can draw circles and rectangles, as demonstrated in the sample application. However, I’m exploring an alternative workflow specifically for drawing rectangles and circles.
case ArcgisMapEnums::Drawings::rectangle:
{
m_geometryEditor->setTool(m_rectangleTool);
m_geometryEditor->start(GeometryType::Polygon);
}
break;
case ArcgisMapEnums::Drawings::circle:
{
m_geometryEditor->setTool(m_ellipseTool);
m_geometryEditor->start(GeometryType::Polygon);
}
break;
Circle and Rectangle Drawing Enhancement
Currently, to draw a circle, I need to click and drag the mouse, which defines the bounding area. Instead, I would like to implement a more precise workflow where:
- The user clicks once to define the center point.
- As the user moves the mouse, a preview (feedback) of the circle is shown dynamically.
- Upon clicking the second point, the final circle is drawn.
- The drawn shape must always be a perfect circle (equal radius in all directions), not an oval or something else.
The same logic should apply to rectangles:
- First click defines one corner.
- On hover, a preview of the rectangle is shown.
- Second click finalizes the shape.
- The rectangle must have a fixed aspect ratio or specific constraints (optional).
Unified Drawing and Replay Structure
I am also looking for guidance on the structure of my drawing logic. Currently, I am saving all drawn features—such as circles, rectangles, and polygons—into a storage format (e.g., JSON or a custom format). When the user clicks a "Load" button, I want all the drawings to be rendered exactly as they were created, but without requiring user interaction.
After loading, users should be able to edit or delete the shapes just as they would if they had drawn them manually.