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

Question : draw:editstop:save event ? #545

Open
mustikka opened this issue Jun 3, 2016 · 6 comments
Open

Question : draw:editstop:save event ? #545

mustikka opened this issue Jun 3, 2016 · 6 comments

Comments

@mustikka
Copy link

mustikka commented Jun 3, 2016

Hello,
I am adding extra data in a popup when editing. It would be nice to have an editstop:cancel event and an editstop:save event to known if I have to save these data or delete them. I can't manage the distinction in the current editstop event...

// Triggered on cancel and save
map.on('draw:editstop', function (e) {
    if (e.something == 'save') {
        saveExtraData()
    }
});

Or is there another way ?
Thank you

@visernchua
Copy link

When will this functions will be added? Is there anyone has an alternative solution for this at the meantime.

@mustikka
Copy link
Author

Until now, I manage this missing feature with jquery. But this is a pretty ugly hack... It would be better to have separate events.

$('#map .leaflet-draw-section:eq(1) .leaflet-draw-actions li:eq(1) a').on('click', (e) => {
    console.log('cancel event');
    this.cancelEvent = true;
});

@germanjoey
Copy link

germanjoey commented Jan 17, 2017 via email

@danielduhh
Copy link

whats the status on this?

@wh1le
Copy link

wh1le commented Jun 5, 2020

@danielduhh I found that if you want to check whenever to save button triggered you can use draw:edited callback

@1765659645
Copy link

It's 2022, does anyone have a solution for this problem?

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

No branches or pull requests

6 participants