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

Add minimize/restore event request #125

Open
rendrom opened this issue Apr 18, 2017 · 2 comments
Open

Add minimize/restore event request #125

rendrom opened this issue Apr 18, 2017 · 2 comments

Comments

@rendrom
Copy link
Contributor

rendrom commented Apr 18, 2017

Please add "fire" events for minimize and restore actions.

@rendrom
Copy link
Contributor Author

rendrom commented Apr 18, 2017

My current solution with extend:

var EventedMiniMap = L.Control.MiniMap.extend({

    includes: L.Mixin.Events,

    _minimize: function () {
        L.Control.MiniMap.prototype._minimize.call(this);
        this.fire("minimized");
    },

    _restore: function () {
        L.Control.MiniMap.prototype._restore.call(this);
        this.fire("restore");
    },
});

@robpvn
Copy link
Contributor

robpvn commented Apr 26, 2017

Seems doable, maybe even you would like to contribute it? 👍

rendrom added a commit to rendrom/Leaflet-MiniMap that referenced this issue Apr 26, 2017
Events - `minimized`, `restore` and `toggle for both;
add event example;
update readme.
rendrom added a commit to rendrom/Leaflet-MiniMap that referenced this issue Apr 27, 2017
rendrom added a commit to rendrom/Leaflet-MiniMap that referenced this issue Apr 27, 2017
added toggle button that listens to minimap events
robpvn added a commit that referenced this issue Apr 28, 2017
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

2 participants