geoman-io / leaflet-geoman

πŸ‚πŸ—ΊοΈ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

drawRectangle: clickAndHold + drag + release to draw #1106

Closed rwieruch closed 2 years ago

rwieruch commented 2 years ago

I'd like to change the drawing behavior for the drawRectangle feature.

Instead of "click{x,y} -> click{dx,dy}" which draws an rectangle, I'd like to have it "click&hold{x,y} -> release{dx,dy}" to draw it.

On a higher-level, I already disabled Leaflet's dragging with map.dragging.disable();. For the Rectangle action, I already override it with the following options:

mapRef.pm.enableDraw('Rectangle', {
  snappable: false,
  continueDrawing: true,
  tooltips: false,
  cursorMarker: false,
  rectangleAngle: 45,
  pathOptions: {
    weight: PATH_POLYGON_STYLE.weight,
  },
});

Is there such feature in leaflet-geoman or some workaround that I can use? Thank you!

Falke-Design commented 2 years ago

No this is currently not available. I mark this issue as a Feature Request, so that people can upvote it with a πŸ‘