function addFeature(feature) {
  const layer = viewer.getLayer(currentLayer);
  const defaultAttributes = getDefaultValues(layer.get('attributes'));
  feature.setProperties(defaultAttributes);
  feature.setId(generateUUID());
  editSource.addFeature(feature);
  setActive();
  hasDraw = false;
  saveFeature({
    feature,
    layerName: currentLayer,
    action: 'insert'
  });
  dispatcher.emitChangeEdit('draw', false);
  if (autoForm) {
    // eslint-disable-next-line no-use-before-define
    editAttributes(feature);
  }
}
/**
 * Helper for adding new features. Typically called from various eventhandlers
 * @param {Feature} feature The feature to add.
 */
Helper for adding new features. Typically called from various eventhandlers
@param {Feature} feature The feature to add.
Helper for adding new features . Typically called from various eventhandlers @param { Feature } feature The feature to add .
function addFeature(feature) {
  const layer = viewer.getLayer(currentLayer);
  const defaultAttributes = getDefaultValues(layer.get('attributes'));
  feature.setProperties(defaultAttributes);
  feature.setId(generateUUID());
  editSource.addFeature(feature);
  setActive();
  hasDraw = false;
  saveFeature({
    feature,
    layerName: currentLayer,
    action: 'insert'
  });
  dispatcher.emitChangeEdit('draw', false);
  if (autoForm) {
    editAttributes(feature);
  }
}
function addFeature ( feature ) { const layer = viewer . getLayer ( currentLayer ) ; const defaultAttributes = getDefaultValues ( layer . get ( 'attributes' ) ) ; feature . setProperties ( defaultAttributes ) ; feature . setId ( generateUUID ( ) ) ; editSource . addFeature ( feature ) ; setActive ( ) ; hasDraw = false ; saveFeature ( { feature , layerName : currentLayer , action : 'insert' } ) ; dispatcher . emitChangeEdit ( 'draw' , false ) ; if ( autoForm ) { editAttributes ( feature ) ; } }
Helper for adding new features.
Helper for adding new features .
// eslint-disable-next-line no-use-before-define