Skip to content

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

@bwyss

Description

@bwyss

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions