Giter Club home page Giter Club logo

leaflet-control-orderlayers's People

Contributors

elesdoar avatar snkashis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaflet-control-orderlayers's Issues

featureGroup layers not working in Leaflet 1.0.0-beta.2 ?

I am not sure why, but when I substitute your control in for the standard L.control.layers I see all the base maps, but only one of the overlay layers shows. A picture is worth a 1,000 words (as is a code sample):

commenting out the standard control and it all works just fine. Oh yes, I am using Leaflet 1.0.0-beta.2 and perhaps that is the issue (Chrome).

Here is one idea. The carLayer is actually a L.featureGroup, with a marker in it.

            var baseMaps = {
                "OSM Light": osmLight,
                "OSM Satellite": osmSatellite,
                "OSM Bold": osmComic
            };
            var overlayMaps = {
                "MCity": mapLayer,
                "Live Car": carLayer
            };

            var controls = L.control.orderlayers(baseMaps, overlayMaps, { collapsed: false });

            //var controls = L.control.layers(baseMaps, overlayMaps, { collapsed: false });
            controls.addTo(theMap);

croppercapture 1

geoJson

Is it possible to add geojson layer? It works in L.control.layers but in orderlayers I can display only wms layer.

colliding z-index for bottom and top layers

I've defined several base maps (bottom layers) and about a dozen data layers (top layers), and have found that I get conflicting z-index ordering when selecting the layers. I've the plugin rendering into two panes of an accordion panel and both start with a z-index of 1. That's fine for when I only want to display a base map. Once I start adding data layers, they start getting rendered below the base map; base map X has z-index of 4 and data layer has z-index of 2. I'm not sure how to programmatically tell the bottom and top layers to start at a given z-index or how to ensure the top layers always have a min z-index of one greater than the max of the bottom layers. Could you provide any fixes or suggestions?

I've attached an image from firefox dev tool inspector. The highlighted div is the base map layer.
inspector

Scott

Layers order at start

Hi,
first of all thank you for this plugin.

I have a stupid question: how to set the Layers order at start?

The first layer in my list is that one with zIndex 3, and it's before those with zIndex 2 and 1.
Why the firt is not the one with zIndex 1?

This is my example page: http://aborruso.github.io/monferrato/index_3.html

Thank you

Can't add a layer group to the layer control

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

TypeError: obj.layer.options is undefined leaflet.control.orderlayers.js:100

This plugin fails with when overlayers miss .options.zindex. This happens for L.GPX and vector overlay. L.imageOverlay has zindex, but if you have more than one with same zindex, only the last one shows in the control. base layers shows.Code snippets failing:

var blay  = {'Statkart': topo2, 'Statkart2': topor2, 'Google':googleLayer, 'Satelitt':gsat, 'Openstreetmap':osm };
var olay = {};
mapControl = L.control.orderlayers(
blay, olay, 
{ collapsed: false,
  title: 'Order Layers', autoZIndex: true
}
);

rings.push( L.circle(to, 20, {color: 'red', fill:false}) );
var clayer = L.layerGroup(rings, {zIndex: 20});
clayer.setZIndex(20);
clayer.addTo(map);
mapControl.addOverlay(clayer, 'my rings');

Leaflet is 0.7.1 and oderLayers is straight from git.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.