Skip to content

draw

Stable

Lets the user draw and edit shapes on the map, such as geofences, from a toolbar of its own or the application's buttons, sends them to the LiveView as GeoJSON, and shows the shapes the LiveView gives it.

The events this component sends to the LiveView, as the library documents them. Each arrives in handle_event/3. Use the preview; the last payload of each event the example receives appears here. A component sends only the events its events attribute names, so the example receives those its LiveView handles.

  • draw:created

    The user finished drawing a shape

    Not received yet.

  • draw:updated

    The user edited a shape, once the edit ends

    Not received yet.

  • draw:deleted

    The user deleted a shape

    Not received yet.

  • draw:started

    The user placed the first point of a new polygon, line, rectangle or circle (a point has none)

    Not received yet.

  • draw:cancelled

    A shape under way was given up, and is no shape

    Not received yet.

  • draw:mode_changed

    A button of the toolbar set the mode, or asks the LiveView for it

    Not received yet.