Open nstjean opened 4 years ago
Awesome. Right now LEL will default to grey-scale if a user does not pass in a baseLayer. It is done in this line here: https://github.com/publiclab/leaflet-environmental-layers/blob/7cf1aa1b19e9b3728901465255d13ab3f028a786/src/AllLayers.js#L79
If we have plans to add more than one baselayer option for the user to choose we could initialize those layers within LEL just like how we've done for the overlay layers.
Awesome!!!
Oh great! It didn't seem to be working in plots2, but I wonder if it will now. I'll check on that while I'm working on /map/ !
So your lovely changes aren't in plots2 yet, so I bumped the LEL version here: https://github.com/publiclab/leaflet-environmental-layers/pull/368
So your lovely changes aren't in plots2 yet, so I bumped the LEL version here: #368
There was a bug that did allow the default base layer in the one-liner code to appear when multiple maps were added to the same page. It should work now with this change once this version is added to plots2. 😄 https://github.com/publiclab/leaflet-environmental-layers/blob/4109b587196fbe35b2adfc24ce9503e206d54bee/src/AllLayers.js#L76-L79
Our current method for displaying a base layer is this:
https://github.com/publiclab/leaflet-environmental-layers/blob/7cf1aa1b19e9b3728901465255d13ab3f028a786/example/oneLinerCodeExample.html#L69-L93
I feel like we can clean this up further by saving the baselayer data in the source code instead of requiring the user to provide it each time. The usage would look like this:
We could allow people to provide their own baselayers in addition, just as they do now. But this way it would be much easier to create a map, you just have to name which bases you want.