Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use rotate as the default starting behavior #51

Closed
wmaiouiru opened this issue Jun 23, 2015 · 5 comments
Closed

use rotate as the default starting behavior #51

wmaiouiru opened this issue Jun 23, 2015 · 5 comments

Comments

@wmaiouiru
Copy link

Is there any way to use the rotate mode as the default behavior?
I tried to set the mode to rotate on initialization but had no luck. I also tried to set the mode manually but had no luck either.

im=new L.DistortableImageOverlay(im_url,mode:'rotate').addTo(map);
im.editing._mode='rotate'
@jywarren
Copy link
Member

Hi, @wmaiouiru - there's also been a request for this in the MapKnitter repo, and we're discussing there: publiclab/mapknitter#183

Just curious - what are you using the plugin for? We're very interested in supporting its use in other projects; eager to share and support common use cases.

@wmaiouiru
Copy link
Author

@jywarren thank you for the quick reply. I am using the plugin for overlaying layers onto maps, and I found the interface quite nice.

@jywarren
Copy link
Member

Glad to hear it! We're considering making rotate/scale the default starting tool.

For your code, I believe that you may need to run your second line within a "load" callback, after the image has loaded, as in https://github.com/publiclab/mapknitter/blob/master/app/assets/javascripts/mapknitter/Map.js#L132

Then potentially call img.fire('update'); to trigger it to update, although I forget if this is necessary.

@jywarren jywarren changed the title Is there any way to use the rotate as the default behavior? use rotate as the default starting behavior Jul 6, 2015
@maartenvandillen
Copy link

Thanks for the info, but I could only get this to work by calling the img.editing._toggleRotateDistort() function. Otherwise the handlers were not in sync with the internal mode.

@sashadev-sky
Copy link
Member

@wmaiouiru @maartenvandillen We heard you guys and have just merged PR #206: which allows a user to pass a mode option during L.distortableImageOverlay initialization, with the value being the desired default starting editing mode.

Please checkout the Mode section in the README for someone additional information on using this option and a code block example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants