title: OpenLayers v3.4 getting layer bounding box and CRS data from GeoServer
body: <p>I'm looking into OpenLayers v3.4 along with GeoServer.
  I'm trying to collect the correct bounding box / extent data from a shape file which I've already uploaded to GeoServer.</p>
  
  <p>Here I am collecting the layer from the server.</p>
  
  <pre><code>var vectorLayer = new ol.layer.Tile({
      source: new ol.source.TileWMS({
          preload: Infinity,
          url: 'http://localhost:8080/geoserver/Newcastle/wms',
          serverType: 'geoserver',
          params: {
              'LAYERS': "Newcastle:Newcastle_Coverage", 'TILED': true
          }
      })
  });
  map.addLayer(vectorLayer);
  </code></pre>
  
  <p>I would have thought I could have just called the extent from the layer.</p>
  
  <pre><code>var extent = vectorLayer.extent;
  </code></pre>
  
  <p>But alas, the extent is alwayd 'undefined' which is totally useless to me.
  I then try to collect the data from using the WMSCapabilities function directly from the XML server download.</p>
  
  <pre><code>    var featurePrefix = '***';
      var featureType = '***';
      var url = 'http://localhost:8080/geoserver/wms?request=GetCapabilities&amp;service=WMS&amp;version=1.1.1';
      var parser = new ol.format.WMSCapabilities();
  
  
      $.ajax(url).then(function (response) {
          //window.alert("word");
          var result = parser.read(response);
          console.log(result);
          window.alert(result);
          var Layers = result.Capability.Layer.Layer;
          var extent;
          for (var i = 0, len = Layers.length; i &lt; len; i++) {
  
              var layerobj = Layers[i];
              window.alert(layerobj.Name);
  
              if (layerobj.Name == "Newcastle:Newcastle_Coverage")
              {
                  extent = layerobj.BoundingBox[0].extent;
              }
          }
      });
  </code></pre>
  
  <p>This works to some degree, it does return the bounding box of the defined CRS of the data.  In this case its EPSG:28356 (MGA56).  I know its MGA56 because I uploaded it and told it what it was.<p>
  What I need is to get the CRS details for shape files that I don't know.  How do I know if its MGA55 or MGA54 etc.  I cannot find a way to get this particular information out.</p>