The Create and Edit sample illustrates how to create vector shapes on the map or modify existing ones via (freehand) map drawing. LuciadRIA supports points, polylines, polygons, circles, ellipses, circular arcs, elliptical arcs, arc bands, geo buffers and extruded shapes.
There are 2 themes in this sample:
Select an object to start editing it.
When editing the shape, you can drag the entire shape or move individual vertices by moving the handles. To insert vertices in a polyline, polygon or geo buffer, select the small handle in the middle of the line segment. To delete vertices in a polyline, polygon or geo buffer, press down and hold one editing handles of the shape's points. You can also hold down the Ctrl button, and click on a point's handle to delete it. To finish the editing, click on the map outside the shape.
When editing an extruded shape, a panel opens that shows the shape's minimum and maximum height. This panel is synchronized with edits you do on the map.
You can undo and redo shape edits by pressing the undo/redo buttons at the bottom of the page. Alternatively, you can press CTRL+Z and CTRL+Y to undo and redo shape edits. On Mac machines, you can also use CMD+Z to undo and CMD+SHIFT+Z to redo.
Click one of the buttons in the toolbar at the bottom to start creating a new shape. You can create and edit the following shapes: a point, polyline, polygon, circle by 3 points, circle by center point, ellipse, circular arc by 3 points, circular arc by center point, circular arc by bulge, elliptical arc, arc band, geo buffer, as well as quadratic and cubic Bézier curves. To finish creating the object, click on the map outside the shape. For polylines, polygons, and geo buffers, double-click to finish.
While editing or creating shapes, you can revert back to the initial state by pressing the Escape key. If you already are in the initial state, pressing the Escape key will stop the edit or creation process. Alternatively, you can use the new buttons at the bottom when working on a touch-screen device. The left-most button will bring you back in the initial state, the selection button will stop the edit or creation process.
For polylines and polygons you can drag the mouse over the map for freehand drawing. After releasing the mouse, you can continue freehand drawing if you start to drag in the vicinity of the point where you finished.
Right-click on an object to show a context menu that allows you to:
The features you create and edit are stored on the server. A CustomJSONCodec
is used to exchange the features with a server. This codec encodes shapes as GeoJSON except for the shapes that are not covered by the GeoJSON standard. For these shapes the CustomJSONCodec
defines a custom encoding and decoding mechanism.
The custom theme shows some examples of how you can customize creation and editing in LuciadRIA. It shows the following customizations: