-
Notifications
You must be signed in to change notification settings - Fork 26
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
Don't enable by default and don't use the map options #31
Comments
I understand. It was what was needed when I wrote the plugin, but making the behavior opt-in would probably be favorable.
I'm okay with this too. I have a slight preference towards configuring the map, but I'm not attached to it.
If i were to reimplement Once again though, If you put in the work and sent a PR, I'd be happy to put my personal preferences aside. For your issue with the defaults, something like: require('leaflet-sleep');
L.Map.mergeOptions({ /* desired defaults for all maps */ });
// now all maps will use the newly merged options should make things easier (if i'm understanding your issue). |
Thanks for the detailed feedback.
Yes, doing this through a Handler certainly makes sense. For me this was more about an example how an opt-in could look like. My biggest issue is that calling That said, my current solution seems to be working fine. But it felt a bit overly complicated to work around it. So it's not a blocker for me, but maybe this could be considered with the next bigger update or potential rewrite, if there is any :). |
Sounds good. If this plugin ever needs/gets breaking changes, I'll try to fit these two in with a 1.x release:
|
In case anyone's interested, I ended up first forking this project and later rewriting large parts of it to make it fit more nicely with the Leaflet |
I really like this plugin. It seems to be offering exactly what I was looking for.
But I don't like the way the plugin gets activated once it is loaded. Also I think it's not ideal that we use the map options to configure the plugin.
Wouldn't it be better to add this plugin on demand with it's own config options like:
Since using this plugin is only a minor side-track for my code, I have to add special handling like this:
Most other Leaflet plugins seem to use their own construction as well and don't use the map for that.
The text was updated successfully, but these errors were encountered: