Leaflet.DistortableImage icon indicating copy to clipboard operation
Leaflet.DistortableImage copied to clipboard

How to call methods (rotate, scale, lock, etc.) without toolbar and without hot keys?

Open flopail opened this issue 5 years ago • 4 comments

All is in title! ;) I need to use some customized external buttons to call plugin methods:

  • [ ] Toggle image transparency
  • [ ] Delete image
  • [ ] Toggle image outline
  • [ ] Lock / Unlock
  • [x] Rotate
  • [x] Scale
  • [x] Distort
  • [ ] Export
  • [ ] Change order...

Is there a simple way to do it? Thanks, :)

flopail avatar May 20 '19 08:05 flopail

Also assigning @rexagod here :)

sashadev-sky avatar Jun 05 '19 22:06 sashadev-sky

@flopail sorry for the late reply, we have been making updates towards this in our latest npm release!

Each toolbar tool just calls a corresponding private method. I would be happy to walk you through these methods so you can have your own button invoke them, but I would be cautious about doing this as we are expecting changes in the next few weeks that would be possibly breaking in this case.

Let me know. This is definitely noted for adding to our API, though! CC @jywarren

sashadev-sky avatar Jul 04 '19 03:07 sashadev-sky

@flopail check our latest readme! We have exposed scaleBy(), rotateBy() and setCorner() (this is basically what distort is) so far. Working towards the rest.. a lot of code updates and restructuring happening but its getting us closer to a stable API

sashadev-sky avatar Aug 21 '19 12:08 sashadev-sky

published

SidharthBansal avatar Dec 18 '19 10:12 SidharthBansal