stefanocudini / leaflet-panel-layers

Leaflet Control Layers extended with support groups and icons
https://opengeo.tech/maps/leaflet-panel-layers/
MIT License
286 stars 92 forks source link

Put geoJson var instead of creating it? #3

Closed rossanag closed 9 years ago

rossanag commented 9 years ago

Hi, I am using your plugin, but I am facing some troubles. It doesn't display the "overlay" name (the one the user sees) in some cases, and the items aren't ordered as it they are within the array. This is how code looks:

var layerBars = L.geoJson(Bar, { ....and other geoJson options});

Then

var overLayers = [
    {
        name: "Bar",
        icon: iconByName('bar'),
        layer:  layerBars
     },
        ......

I am new with JS and CSS, I don't know if the problem has to do with CSS too. I thought I had to create the L.geoJson within the array declaration, I didn't try it yet. Any suggestion? Thanks!

stefanocudini commented 9 years ago

try like as this demo: https://github.com/stefanocudini/leaflet-panel-layers/blob/master/examples/embedded-layers.html#L67

rossanag commented 9 years ago

Thanks! I am going to try it as soon as I can.

2015-03-25 20:53 GMT-03:00 Stefano Cudini notifications@github.com:

Closed #3 https://github.com/stefanocudini/leaflet-panel-layers/issues/3 .

— Reply to this email directly or view it on GitHub https://github.com/stefanocudini/leaflet-panel-layers/issues/3#event-265307241 .