-1
var baseLayers = {
  "Streets": streets,
  "Grayscale": grayscale,
  "Topography": topograph
};

var overlays = {
  "workplaces": workplaces
};

L.control.layers(baseLayers, overlays,myIcon).addTo(map);
TomazicM
  • 25,601
  • 22
  • 29
  • 39
Abdullah
  • 19
  • 1
  • 9
  • 2
    I wish people read the documentation more often. https://leafletjs.com/reference-1.7.1.html#control-layers-collapsed – IvanSanchez Nov 12 '20 at 13:41
  • I tried below example from this site, but it didn't work for me.

    L.control.layers(baseLayers, overlays,null,{collapsed:false}).addTo(map);

    I also tried to make changes in leaflet.js, but no success.

    – Abdullah Nov 12 '20 at 13:50
  • 1
    Please edit you question and put the actual question in the body of the question. – TomazicM Nov 12 '20 at 13:57
  • I found the answer to my question. Its already posted. Thanks for the help. – Abdullah Nov 12 '20 at 14:47

1 Answers1

1

Ok got it. Here is how I answered my question:

`L.control.layers(baseLayers, overlays,{

collapsed:false,

}).addTo(map);`

Abdullah
  • 19
  • 1
  • 9