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

var overlays = {
  "workplaces": workplaces
};

L.control.layers(baseLayers, overlays,myIcon).addTo(map);
  • 2
    I wish people read the documentation more often. leafletjs.com/reference-1.7.1.html#control-layers-collapsed – IvanSanchez Nov 12 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 at 13:50
  • 1
    Please edit you question and put the actual question in the body of the question. – TomazicM Nov 12 at 13:57
  • I found the answer to my question. Its already posted. Thanks for the help. – Abdullah Nov 12 at 14:47
0

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

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

collapsed:false,

}).addTo(map);`

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.