Leaflet.DistortableImage
Leaflet.DistortableImage copied to clipboard
How to call methods (rotate, scale, lock, etc.) without toolbar and without hot keys?
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, :)
Also assigning @rexagod here :)
@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
@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
published