MapEditorField combines points, lines and zones in one field. It enables mixed-feature mode automatically and starts with address search disabled. Use it for service plans, venue layouts or collections that need more than one geometry type.
Basic usage
searchable() only when you also configure an address-search provider; search adds points rather than generating lines or zones.
Tools and geometry restrictions
allowedGeometryTypes() is enforced on the server and must agree with drawingTools(). For a point-and-line editor, configure both lists:
Editing and history
Selected lines support dragging or keyboard movement of vertices, inserting segment midpoints, removing vertices down to two, whole-line movement and rotation. Polygon editing follows the same committed-operation history. Invalid completed geometry does not replace accepted form state.editableZones(false) disables line/polygon vertex and property editing. Point dragging has its own draggableMarkers() policy. deletableFeatures(false) controls removal separately; disabled/read-only fields block edits.
Undo/redo spans geometry types and metadata with a bounded history budget. New edits after undo discard the redo branch. Use feature forms and actions for custom geometry-specific modal forms and PHP callbacks.
State and database storage
Use a JSON column with an Eloquentarray cast. The value is a GeoJSON FeatureCollection containing the admitted Point, LineString and Polygon features. Each feature needs a unique stable ID. GeoJSON coordinate pairs use [longitude, latitude].
Collection modes require structured storage. Supplied mapFeatures() overlays are separate from this editable state and are not automatically persisted with it.
Limits and appearance
The geometry boundary also enforces a 10,000-total-vertex limit and validates submitted topology independently of the browser. Zone-specific area and overlap policies are described on MapZonesField.