<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
styledLayerControl.css, styledLayerControl.js 참조 추가 (파일 추가)<link rel="stylesheet" href="../css/styledLayerControl.css" /> <script src="../src/styledLayerControl.js"></script>
var options = { container_width : "200px", container_maxHeight : "350px", group_maxHeight : "80px", exclusive : false } styledLayerControl = L.Control.styledLayerControl(null, null, options); map.addControl(styledLayerControl);
control.addOverlay( layer, "LAYER NAME", {groupName : "GROUP NAME"} );
시작시에 그룹이 확장된 상태로 있게 하려면, expanded 옵션을 추가해 준다.
control.addOverlay( layer, "LAYER NAME", {groupName : "GROUP NAME", expanded: true} );