diff options
| author | diogo464 <[email protected]> | 2024-10-02 09:53:06 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2024-10-02 09:53:06 +0100 |
| commit | 09599bbf58492ea5bb27d1c6ae1980dc925b3d41 (patch) | |
| tree | 877f455095ceffbeb84aeaa5e865427f1e62ae79 /content/static | |
| parent | 4b096ed372253cc791be4c2404b900c8270acddc (diff) | |
select poly with double click or shift click
Diffstat (limited to 'content/static')
| -rw-r--r-- | content/static/main.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/content/static/main.js b/content/static/main.js index f2c8373..3817460 100644 --- a/content/static/main.js +++ b/content/static/main.js | |||
| @@ -299,10 +299,10 @@ function page_shape__ui_shape_add(state, shape) { | |||
| 299 | 299 | ||
| 300 | if (positions.length >= 3) { | 300 | if (positions.length >= 3) { |
| 301 | const opacity = state.selected_shape == shape ? 0.2 : 0.04; | 301 | const opacity = state.selected_shape == shape ? 0.2 : 0.04; |
| 302 | const select = () => page_shape__ui_shape_select(state, shape); | ||
| 302 | const poly = L.polygon(positions, { color: color, fillOpacity: opacity, bubblingMouseEvents: false }) | 303 | const poly = L.polygon(positions, { color: color, fillOpacity: opacity, bubblingMouseEvents: false }) |
| 303 | .on('click', () => { | 304 | .on('click', (e) => { if (e.originalEvent.shiftKey) { select(); } }) |
| 304 | page_shape__ui_shape_select(state, shape); | 305 | .on('dblclick', select) |
| 305 | }) | ||
| 306 | .addTo(state.map); | 306 | .addTo(state.map); |
| 307 | shape.layers.push(poly); | 307 | shape.layers.push(poly); |
| 308 | } | 308 | } |
