title: How to remove layers by name - openlayers 3
body: <p>I was add vector layer with <code>wkt</code> source to map with below code:</p>
  
  <pre><code>var SelectVector = null;
  
  for (var i = 0; i &lt; wktarray.length; i++) {
      var wkt = wktarray[i];
      var format = new ol.format.WKT();
      var feature = format.readFeature(wkt, {
          dataProjection: 'EPSG:4326',
          featureProjection: 'EPSG:4326'
      });
      SelectVector = new ol.layer.Vector({
          source: new ol.source.Vector({
              features: [feature]
          }),
          style: new ol.style.Style({
              fill: new ol.style.Fill({
                  color: 'rgba(255, 255, 255, 0.2)'
              }),
              stroke: new ol.style.Stroke({
                  color: '#ffcc33',
                  width: 2
              }),
              image: new ol.style.Circle({
                  radius: 7,
                  fill: new ol.style.Fill({
                      color: '#ffcc33'
                  })
              })
          })
      });
      map.addLayer(SelectVector);
      SelectVector.set('name', 'selectvector');
  }
  </code></pre>
  
  <p>Now, I want remove this vector layer from map. wrote below code but, it does not remove all layer with <code>selectvector</code> name.</p>
  
  <pre><code>map.getLayers().forEach(function (layer) {
      if (layer.get('name') != undefined &amp; layer.get('name') === 'selectvector') {
          map.removeLayer(layer);
      }
  });
  </code></pre>
  
  <p>what is wrong?</p>