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

Can't add a layer group to the layer control #3

Open
bwyss opened this issue Jan 12, 2015 · 1 comment
Open

Can't add a layer group to the layer control #3

bwyss opened this issue Jan 12, 2015 · 1 comment
Assignees
Milestone

Comments

@bwyss
Copy link

bwyss commented Jan 12, 2015

I am able to add the layer to the layer control, but not a layer group.

here is a snippet of what I am trying to do:

        var layerControl = L.control.orderlayers();

        var tileLayer = L.tileLayer(TILESTREAM_URL +
            selectedLayer +
            '/{z}/{x}/{y}.png',{wax: TILESTREAM_URL +
            selectedLayer +
            '.json'});

        var utfGridLoss = new L.UtfGrid(TILESTREAM_URL +
            selectedLayer +
            '/{z}/{x}/{y}.grid.json?callback={cb}', {Default: false, JsonP: false});

        var utfGrid = L.layerGroup([
            utfGridLoss,
            tileLayer
        ]);

        map.addLayer(utfGrid);
        layerControl.addOverlay(utfGrid, selectedLayer); // does not work
        layerControl.addOverlay(tileLayer, selectedLayer); // works
@bwyss
Copy link
Author

bwyss commented Mar 31, 2015

I was able to get around this issue by using a leaflet featureGroup, but the UtfGrid layer does not follow the layer order change

@elesdoar elesdoar self-assigned this Mar 31, 2015
@elesdoar elesdoar added this to the 0.3.0 milestone Nov 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants