Skip to main content
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

Rendering, styles, camera limits and controls use the shared map configuration. Add 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:
Enter/Finish commits a polyline with at least two distinct adjacent vertices. Escape cancels a draft and Backspace removes its latest point. Polygon, rectangle and circle interactions follow the zone editor.

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 Eloquent array 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.

Supported scope

Lines represent geometry supplied or drawn by your application; the field does not calculate routes. Mixed-feature mode is unclustered. Use MapMarkersField for clustered Point collections. Polygon holes, polygon cutting/merging, freehand drawing, text annotations and continuous device GPS tracking are not implemented.
Last modified on October 16, 2026