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

Support for multiple layers #1

Closed
keithj2780 opened this issue Sep 16, 2020 · 5 comments
Closed

Support for multiple layers #1

keithj2780 opened this issue Sep 16, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@keithj2780
Copy link

Consider changing tileLayer to an array.
My requirement has a multiples layers from different sources, each with different opacities.
I'd also like to add & remove layers based on UI interaction... and the Map Component to react to those changes in the options.

@peopledrivemecrazy
Copy link
Member

Can you give me an example? Yes, the map component isn't reactive yet I am working on it.

@keithj2780
Copy link
Author

keithj2780 commented Sep 17, 2020

    leaflet.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png ', {
        attribution:  'xxx',
        maxZoom:      22,
        minZoom:      5,
        opacity: 1.0
      }).addTo(map);

      googleStreetLayer = leaflet.tileLayer('//{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{
        maxZoom: 36,
        subdomains:['mt0','mt1','mt2','mt3'],
        attribution:  'yyy',
        minZoom:      5,
        opacity: 0.0
      });
      googleStreetLayer.addTo(map);

      googleImageryLayer = leaflet.tileLayer('//{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',{
        maxZoom: 36,
        subdomains:['mt0','mt1','mt2','mt3'],
        attribution:  'zzz',
        minZoom:      5,
        opacity: 0.0
      });
      googleImageryLayer.addTo(map);

Reactivity would be great 👍

@peopledrivemecrazy peopledrivemecrazy added the enhancement New feature or request label Sep 17, 2020
@peopledrivemecrazy
Copy link
Member

I might have a working example but not ready yet.
image

Thanks for your suggestion, I will investigate this further and add this by tonight or tomorrow.

@peopledrivemecrazy
Copy link
Member

@keithj2780 This will introduce a breaking change on current tileLayer not being an array I require more time on this and add it along with reactivity.

@peopledrivemecrazy
Copy link
Member

@keithj2780 have a look at this check this out https://leaflet.anoram.com/examples/tilelayer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants