-
Notifications
You must be signed in to change notification settings - Fork 637
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
New Features and Options #285
Conversation
Wow, fantastic addition! Thanks so much for sharing @elesdoar! |
Hi, I have modified a little the layers control, let me explain about this. First of all, I have created a new configuration section controls where we could put every new control that we want to support on the directive. You can take a look here: https://github.com/tombatossals/angular-leaflet-directive/blob/master/src/services/leafletMapDefaults.js#L13
Furthermore, I have made all the parameteres declarative, I think its better not to relay on Leaflet object on the controller layer, so we must avoid any declaration similar to this:
It's better to wrap the syntax, make it more declarative, and create the Leaflet objects inside the leaflet-library. I haven't been able to automatically remove the layerControl of the map when there is only one layer left. I have to take a closer look at this. I have disabled the removeControlLayer funcionality, as you can see there: https://github.com/tombatossals/angular-leaflet-directive/blob/master/src/services/leafletControlHelpers.js#L20 That said, your patch is fantastic, thanks so much. I'm thinking about making a controls attribute where we could add more plugin-controls like autodiscover, zoom, etc. What do you think about it? Something like:
|
I think it's a good idea. By the way, I thought of doing something similar. Although I've been busy these days, I'll work on it soon. |
I finally managed to get working the add/remove of the layersControl if baselayers+overlays <= 1. I have created a demo to: http://tombatossals.github.io/angular-leaflet-directive/examples/layers-add-remove.html Thanks for your work @elesdoar |
Hello, |
Great Idea!!! Thanks |
This is all great and stuff! The only thing is, whats the final way of actually moving the Layers-controller to the bottomright-position? |
Hi,
This commit have:
With these new options, the control layer can be any plugin that extends L.Control.Layer.
Hope you like it 👍