How to use the @igo2/common.FormFieldComponent function in @igo2/common

To help you get started, we’ve selected a few @igo2/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / geometry / geometry-form-field / geometry-form-field.component.ts View on Github external
import { BehaviorSubject, Subscription } from 'rxjs';

import OlGeometryType from 'ol/geom/GeometryType';
import { Style as OlStyle } from 'ol/style';

import { FormFieldComponent } from '@igo2/common';

import { IgoMap } from '../../map';
import { GeoJSONGeometry } from '../shared/geometry.interfaces';

/**
 * This input allows a user to draw a new geometry or to edit
 * an existing one on a map.
 */
@FormFieldComponent('geometry')
@Component({
  selector: 'igo-geometry-form-field',
  templateUrl: './geometry-form-field.component.html',
  styleUrls: ['./geometry-form-field.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class GeometryFormFieldComponent implements OnInit, OnDestroy {

  readonly value$: BehaviorSubject = new BehaviorSubject(undefined);

  private value$$: Subscription;

  public drawControlIsActive = true;
  public freehandDrawIsActive = false;

  /**