title: How to get geometry type of a layer?
body: <p>I am producing my layers like this:</p>
  <pre><code>// Vector source for geoserver services
  const vectorSource = (layer) =&gt; {
    return new ol.source.Vector({
      format: new ol.format.GeoJSON(),
      url: (extent) =&gt; {
        return (`http://localhost:8080/geoserver/Bugra/ows?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typeName=Bugra:${layer}&amp;outputFormat=application/json&amp;srsname=EPSG:3857&amp;bbox=${extent.join(',')},EPSG:3857`);
      },
      strategy: ol.loadingstrategy.bbox,
    })
  };
  </code></pre>
  <p>and then using this one:</p>
  <pre><code>// Layer creating class
  class LayerCreator {
    constructor(
      lyrName, lyrGeoServerName, lyrStrokeColor,
      lyrStrokeWidth, lyrFillColor, lyrOpacity,
      lyrPointRadius, lyrMinZoom, lyrMaxZoom,
      lyrLabelField, lyrFontFamily, lyrFontFillColor,
      lyrFontStrokeColor, lyrFontStrokeWidth, lyrFontBold,
      lyrFontSize, lyrFontPlacement, lyrFontOffsetY) {
  
      return new ol.layer.Vector({
        className: `${lyrName}-${lyrGeoServerName}`,
        source: vectorSource(lyrGeoServerName),
        style: function text(feature) {
          return new ol.style.Style({
            stroke: new ol.style.Stroke({
              color: lyrStrokeColor,
              width: lyrStrokeWidth,
            }),
            fill: new ol.style.Fill({
              color: lyrFillColor
            }),
            image: new ol.style.Circle({
              radius: lyrPointRadius,
              fill: new ol.style.Fill({
                color: lyrFillColor
              }),
              stroke: new ol.style.Stroke({
                color: lyrStrokeColor,
                width: lyrStrokeWidth,
              })
            }),
            text: new ol.style.Text({
              text: feature.get(lyrLabelField),
              font: `${lyrFontBold} ${lyrFontSize}px ${lyrFontFamily}`,
              fill: new ol.style.Fill({
                color: lyrFontFillColor,
              }),
              stroke: new ol.style.Stroke({
                color: lyrFontStrokeColor,
                width: lyrFontStrokeWidth,
              }),
              placement: lyrFontPlacement,
              offsetY: lyrFontOffsetY
            }),
          })
        },
        opacity: lyrOpacity,
        minZoom: lyrMinZoom,
        maxZoom: lyrMaxZoom,
      });
    }
  }
  </code></pre>
  <p>The problem is, I got a Draw widget and as you know it needs a &quot;type&quot; value to know what of type of geometry it will create. I got a combobox with all 10 layers whic i created just like above. They are ol.layer.Vector type objects. So i have to dynamically change Draw widgets &quot;type&quot; value according to the geometry type of the layer that i choose from combobox. If it's type is &quot;MultiPolygon&quot; i have to send it to Draw widget as 'type: &quot;MultiPolygon&quot;' but i couldn't fetch the geometry type from ol.layer.Vector objects.</p>
  <p>Can you help me pls?</p>
  <p><a href="https://i.stack.imgur.com/ISjoX.png" rel="nofollow noreferrer">ui</a></p>