Skip to content

Commit

Permalink
add lasso radio on lasso configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
warm-coolguy committed Feb 20, 2025
1 parent 00f334f commit 05b43f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 1 addition & 3 deletions packages/plugins/Draw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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. |
Expand Down
2 changes: 2 additions & 0 deletions packages/plugins/Draw/src/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
16 changes: 10 additions & 6 deletions packages/plugins/Draw/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {},
Expand Down

0 comments on commit 05b43f3

Please sign in to comment.