Skip to content

Commit 96d4f42

Browse files
authored
Merge pull request #455 from fschmenger/measure_tool_left_click_only
Restrict the measure tool draw interaction to the left mouse button.
2 parents 7147cb1 + cb8d9c8 commit 96d4f42

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/measuretool/OlMeasureController.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ export default class OlMeasureController {
7474
}
7575

7676
const type = (measureType === 'area' ? 'Polygon' : 'LineString');
77+
const leftClickOnly = (event) => event.originalEvent.button === 0;
78+
7779
const draw = new DrawInteraction({
7880
source: me.source,
81+
condition: leftClickOnly,
7982
type,
8083
maxPoints: measureType === 'angle' ? 2 : undefined,
8184
style: new Style({

0 commit comments

Comments
 (0)