title: How To show ol-3 Layer Switcher
body: <p>I'm developing a GIS and I have trouble to show Layer Switcher. In this case I used Open Layers 3.</p>
  
  <pre><code>map = new ol.Map({
          controls: ol.control.defaults({
            attribution: false
          }).extend([mousePositionControl,zoomslider]),
          target: document.getElementById('map'),
          layers: [
      new ol.layer.Group({
          'title': 'BaseMaps',
          layers: [
          new ol.layer.Tile({
              title: 'RoadMaps',
              source: new ol.source.OSM({
                  url: 'http://mt{0-3}.google.com/vt/lyrs=m&amp;x={x}&amp;y={y}&amp;z={z}',
                  attributions: [
                  new ol.Attribution({ html: '© Google' }),
                  new ol.Attribution({ html: '&lt;a href="https://developers.google.com/maps/terms"&gt;Terms of Use.&lt;/a&gt;' })
                  ]
              })
          }),
          new ol.layer.Tile({
              title: 'Satelite',
              type: 'base',
              visible: false,
              source: new ol.source.OSM({
                  url: 'http://mt{0-3}.google.com/vt/lyrs=m&amp;x={x}&amp;y={y}&amp;z={z}',
                  attributions: [
                  new ol.Attribution({ html: '© Google' }),
                  new ol.Attribution({ html: '&lt;a href="https://developers.google.com/maps/terms"&gt;Terms of Use.&lt;/a&gt;' })
                  ]
              })
          }),
              new ol.layer.Tile({
              title: 'OSM',
              type: 'base',
              visible: true,
              source: new ol.source.OSM()
          })
          ]
          peta_highlight,
          layers['layer_kategori'],
      })
          ],
  
          view: new ol.View({
              projection: "EPSG:3857",
          })              
      });
  
      layerSwitcher = new ol.control.LayerSwitcher({
      tipLabel: 'Légende' // Optional label for button
      });
      map.addControl(layerSwitcher);
  </code></pre>
  
  <p>At this point my code is still not working and the three maps can't show on my website.</p>