Skip to content

Commit 05b43f3

Browse files
committed
add lasso radio on lasso configuration
1 parent 00f334f commit 05b43f3

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

packages/plugins/Draw/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The styling of the drawn features can be configured to overwrite the default ol-
3535
| - | - | - |
3636
| 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. |
3737
| enableOptions | boolean? | If `true`, draw options are displayed, like choosing and changing stroke color. Not available for texts features. Defaults to `false`. |
38-
| 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. |
38+
| 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. |
3939
| 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. |
4040
| 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. |
4141
| selectableDrawModes | string[]? | List 'Point', 'LineString', 'Circle', 'Text' and/or 'Polygon' as desired. All besides 'Text' are selectable by default. |
@@ -78,8 +78,6 @@ draw: {
7878

7979
#### draw.lasso
8080

81-
This feature currently has no UI and can only be started with a programmatic `mapInstance.$store.dispatch('plugin/draw/setMode', 'lasso')` call.
82-
8381
| fieldName | type | description |
8482
| - | - | - |
8583
| id | string | The layer id of a vector layer to copy up vector features from. |

packages/plugins/Draw/src/locales.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const resourcesDe = {
99
measure: 'Zeichnen und Messen',
1010
write: 'Zeichnen und Schreiben',
1111
writeAndMeasure: 'Zeichnen, Schreiben und Messen',
12+
lasso: 'Lasso',
1213
edit: 'Bearbeiten',
1314
translate: 'Verschieben',
1415
delete: 'Löschen',
@@ -57,6 +58,7 @@ export const resourcesEn = {
5758
measure: 'Draw and measure',
5859
write: 'Draw and write',
5960
writeAndMeasure: 'Draw, write and measure',
61+
lasso: 'Lasso',
6062
edit: 'Edit',
6163
translate: 'Translate',
6264
delete: 'Delete',

packages/plugins/Draw/src/store/index.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,17 @@ export const makeStoreModule = () => {
7979
} else if (includesMeasure) {
8080
drawLabel = 'measure'
8181
}
82-
return {
83-
none: 'plugins.draw.mode.none',
84-
draw: `plugins.draw.mode.${drawLabel}`,
85-
edit: 'plugins.draw.mode.edit',
86-
translate: 'plugins.draw.mode.translate',
87-
delete: 'plugins.draw.mode.delete',
82+
const modes = [
83+
['none', 'plugins.draw.mode.none'],
84+
['draw', `plugins.draw.mode.${drawLabel}`],
85+
['edit', 'plugins.draw.mode.edit'],
86+
['translate', 'plugins.draw.mode.translate'],
87+
['delete', 'plugins.draw.mode.delete'],
88+
]
89+
if (configuration.lassos) {
90+
modes.splice(4, 0, ['lasso', 'plugins.draw.mode.lasso'])
8891
}
92+
return Object.fromEntries(modes)
8993
},
9094
measureOptions: (_, { configuration }) =>
9195
configuration.measureOptions || {},

0 commit comments

Comments
 (0)