publiclab / leaflet-environmental-layers

Collection of different environmental map layers in an easy to use Leaflet library, similar to https://github.com/leaflet-extras/leaflet-providers#leaflet-providers
https://publiclab.github.io/leaflet-environmental-layers/example/
GNU General Public License v3.0
99 stars 77 forks source link

Adding base layer as a part of LEL API #242

Open sagarpreet-chadha opened 5 years ago

sagarpreet-chadha commented 5 years ago

Quoting myself

I am not yet merging this because base layers are not part of LEL API . It is used just as an example , we plan to integrate baselayers as an option in the future . Example : map123.addBaseLayer("greyscale")

Let' add the functionality to add BASE LAYERS from LEL API only . map123.addBaseLayer("greyscale")

Where

 addBaseLayer: (baselayer) => {
  switch(baselayer) {
       case 'greyscale' : 
               const baselayer1 = L.tileLayer(
        "https://api.tiles.mapbox.com/v4/mapbox.emerald/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoic2FnYXJwcmVldDk3IiwiYSI6ImNqaXhlZjgwaDJtb3EzcW1zdDdwMzJkODcifQ.MA2YIv6VpGLLAo-QYUudTA",
        {
          attribution:
            '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
        }
      ).addTo(map);
  }

}
nstjean commented 5 years ago

I can do this!

sagarpreet-chadha commented 5 years ago

Yes awesome! Go ahead :)

On Wed, 6 Nov 2019, 20:10 Natalie St Jean, notifications@github.com wrote:

I can do this!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/leaflet-environmental-layers/issues/242?email_source=notifications&email_token=ADSCRROKTHQSCAP4VF4JDFLQSLJPBA5CNFSM4IMTYDAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDGYGSA#issuecomment-550339400, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSCRRKKGG6SPC53LDJTQPDQSLJPBANCNFSM4IMTYDAA .