diff --git a/packages/plugins/Draw/README.md b/packages/plugins/Draw/README.md index 8a3211849..079db3b34 100644 --- a/packages/plugins/Draw/README.md +++ b/packages/plugins/Draw/README.md @@ -35,7 +35,7 @@ The styling of the drawn features can be configured to overwrite the default ol- | - | - | - | | addLoading | string? | Expects the path to a mutation within the store. This mutation is committed with a plugin-specific loading key as payload when starting asynchronous procedures that are intended to be communicated to the user. | | enableOptions | boolean? | If `true`, draw options are displayed, like choosing and changing stroke color. Not available for texts features. Defaults to `false`. | -| lassos | lasso[]? | Allows configuring lasso options. The lasso function allows free-hand drawing a geometry on the map; features completely fitting into that geometry will be copied up to the draw layer from all configured layers. 💡 Please mind that the lasso function currently has no UI in the client, and the functionality must be triggered externally. | +| lassos | lasso[]? | Allows configuring lasso options. The lasso function allows free-hand drawing a geometry on the map; features completely fitting into that geometry will be copied up to the draw layer from all configured layers. UI-wise, it is not intuitive for users do understand what a "Lasso" does. This feature currently requires further instructions by the outlying UI on what one is supposed to do with it. | | removeLoading | string? | Expects the path to a mutation within the store. This mutation is committed with a plugin-specific loading key as payload when finishing asynchronous procedures that are intended to be communicated to the user. | | measureOptions | measureOptions? | If set, an additional radio is being shown to the user to be able to let the (then) drawn features display their length and / or area. See [draw.measureOptions](#drawmeasureoptions) for further information. Not shown by default. | | selectableDrawModes | string[]? | List 'Point', 'LineString', 'Circle', 'Text' and/or 'Polygon' as desired. All besides 'Text' are selectable by default. | @@ -78,8 +78,6 @@ draw: { #### draw.lasso -This feature currently has no UI and can only be started with a programmatic `mapInstance.$store.dispatch('plugin/draw/setMode', 'lasso')` call. - | fieldName | type | description | | - | - | - | | id | string | The layer id of a vector layer to copy up vector features from. | diff --git a/packages/plugins/Draw/src/locales.ts b/packages/plugins/Draw/src/locales.ts index c62214ff8..6a9d0cb14 100644 --- a/packages/plugins/Draw/src/locales.ts +++ b/packages/plugins/Draw/src/locales.ts @@ -9,6 +9,7 @@ export const resourcesDe = { measure: 'Zeichnen und Messen', write: 'Zeichnen und Schreiben', writeAndMeasure: 'Zeichnen, Schreiben und Messen', + lasso: 'Lasso', edit: 'Bearbeiten', translate: 'Verschieben', delete: 'Löschen', @@ -57,6 +58,7 @@ export const resourcesEn = { measure: 'Draw and measure', write: 'Draw and write', writeAndMeasure: 'Draw, write and measure', + lasso: 'Lasso', edit: 'Edit', translate: 'Translate', delete: 'Delete', diff --git a/packages/plugins/Draw/src/store/index.ts b/packages/plugins/Draw/src/store/index.ts index 52e5b4559..6ed0d0d4a 100644 --- a/packages/plugins/Draw/src/store/index.ts +++ b/packages/plugins/Draw/src/store/index.ts @@ -79,13 +79,17 @@ export const makeStoreModule = () => { } else if (includesMeasure) { drawLabel = 'measure' } - return { - none: 'plugins.draw.mode.none', - draw: `plugins.draw.mode.${drawLabel}`, - edit: 'plugins.draw.mode.edit', - translate: 'plugins.draw.mode.translate', - delete: 'plugins.draw.mode.delete', + const modes = [ + ['none', 'plugins.draw.mode.none'], + ['draw', `plugins.draw.mode.${drawLabel}`], + ['edit', 'plugins.draw.mode.edit'], + ['translate', 'plugins.draw.mode.translate'], + ['delete', 'plugins.draw.mode.delete'], + ] + if (configuration.lassos) { + modes.splice(4, 0, ['lasso', 'plugins.draw.mode.lasso']) } + return Object.fromEntries(modes) }, measureOptions: (_, { configuration }) => configuration.measureOptions || {},