Skip to content

Commit

Permalink
modes
Browse files Browse the repository at this point in the history
  • Loading branch information
birkskyum committed Nov 21, 2024
1 parent 7ad1e48 commit 6c07a51
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion src/constants/modes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@



export const ModeStrings = {

/**
* Lets you select, delete, and drag features.
*
* In this mode, features can have their selected state changed by the user.
*
* Draw is in `simple_select` mode by default, and will automatically transition
* into `simple_select` mode again every time the user finishes drawing a feature
* or exits `direct_select` mode.
*/
SIMPLE_SELECT: "simple_select",
/**
* By default MapLibreDraw ships with a few modes. These modes aim to cover the
* basic needed functionally for MapLibreDraw to create the core GeoJSON feature
* types. Along with these, MapLibreDraw also supports
* [custom modes. Click here for more details](https://github.com/mapbox/maplibre-gl-draw/blob/main/docs/MODES.md).
*/
/**
* Lets you draw a LineString feature.
*/
DRAW_LINE_STRING: "draw_line_string",

/**
* Lets you draw a Polygon feature.
*/
DRAW_POLYGON: "draw_polygon",

/**
* Lets you draw a Point feature.
*/
DRAW_POINT: "draw_point",
SIMPLE_SELECT: "simple_select",

/**
* Lets you select, delete, and drag vertices; and drag features.
*
* `direct_select` mode does not apply to point features, because they have no
* vertices.
*
* Draw enters `direct_select` mode when the user clicks a vertex of a selected
* line or polygon. So `direct_select` mode typically follows `simple_select` mode.
*/
DIRECT_SELECT: "direct_select",

/**
* A static mode where no interactions are allowed.
*/
STATIC: "static",
};

0 comments on commit 6c07a51

Please sign in to comment.