How to use @igo2/common - 10 common examples

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 / routing / routing-form / routing-form.component.ts View on Github external
.at(stopIndex)
              .patchValue({ stopProposals: groupedLocations });
            // TODO: Prefer another source?
            if (results[0]) {
              if (results[0].source.getId() === 'icherchereverse') {
                // prefer address type.
                let resultPos = 0;
                for (let i = 0; i < results.length; i++) {
                  const feature: any = results[i].data;
                  if (feature.properties.type === 'adresse') {
                    resultPos = i;
                    break;
                  }
                }
                this.stops.at(stopIndex).patchValue({
                  stopPoint: getEntityTitle(results[resultPos])
                });
                if (results[resultPos].data.geometry.type === 'Point') {
                  this.stops.at(stopIndex).patchValue({
                    stopCoordinates:
                      results[resultPos].data.geometry.coordinates
                  });
                } else {
                  // Not moving the translated point Only to suggest value into the UI.
                }
              } else if (results[0].source.getId() === 'coordinatesreverse') {
                this.stops.at(stopIndex).patchValue({
                  stopPoint: [
                    results[0].data.geometry.coordinates[0].toFixed(5),
                    results[0].data.geometry.coordinates[1].toFixed(5)
                  ].join(',')
                });
github infra-geo-ouverte / igo2-lib / demo / src / app / common / entity-table / entity-table.component.ts View on Github external
{
        name: 'description',
        title: 'Description',
        renderer: EntityTableColumnRenderer.HTML
      },
      {
        name: 'action',
        title: '',
        valueAccessor: (entity: object) => {
          return [{
            icon: 'home',
            color: 'warn',
            click: (row) => { console.log(row); }
          }] as EntityTableButton[];
        },
        renderer: EntityTableColumnRenderer.ButtonGroup
      }
    ]
  };

  constructor(private languageService: LanguageService) {}

  ngOnInit() {
    this.store.load([
      { id: '2', name: 'Name 2', description: '<b>Description 2</b>' },
      { id: '1', name: 'Name 1', description: '<b>Description 1</b>' },
      { id: '3', name: 'Name 3', description: '<b>Description 3</b>' }
    ]);
  }

  ngOnDestroy() {
    this.store.destroy();
github infra-geo-ouverte / igo2-lib / demo / src / app / geo / workspace / workspace.component.ts View on Github external
attribution: {
        collapsed: true
      }
    }
  });

  public view = {
    center: [-72, 47.2],
    zoom: 5
  };

  public workspaceStore = new WorkspaceStore([]);

  public selectedWorkspace$: Observable;

  public actionbarMode = ActionbarMode.Dock;

  public scrollBehavior = EntityTableScrollBehavior.Instant;

  constructor(
    private languageService: LanguageService,
    private dataSourceService: DataSourceService,
    private layerService: LayerService
  ) {}

  ngOnInit() {
    this.selectedWorkspace$ = this.workspaceStore.stateView
      .firstBy$(
        (record: EntityRecord) =&gt; record.state.selected === true
      )
      .pipe(
        map((record: EntityRecord) =&gt; {
github infra-geo-ouverte / igo2 / src / app / pages / portal / toast-panel / toast-panel.component.ts View on Github external
set opened(value: boolean) {
    if (value === this._opened) {
      return;
    }

    this._opened = value;
    this.openedChange.emit(this._opened);
  }
  private _opened = true;

  @Input() zoomAuto = false;

  public icon = 'menu';

  public actionStore = new ActionStore([]);
  public actionbarMode = ActionbarMode.Overlay;

  private multiple$ = new BehaviorSubject(false);
  private isResultSelected$ = new BehaviorSubject(false);
  private initialized = true;

  private format = new olFormatGeoJSON();

  public withZoomButton = true;

  @Output() openedChange = new EventEmitter();
  @Output() zoomAutoEvent = new EventEmitter();

  resultSelected$ = new BehaviorSubject&gt;(undefined);

  @HostBinding('class.app-toast-panel-opened')
  get hasOpenedClass() {
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / catalog / catalog-browser / catalog-browser.component.ts View on Github external
ngOnInit() {
    const currentItems = this.map.layers.map((layer: Layer) => {
      return {
        id: layer.options.source.id,
        title: layer.title,
        type: CatalogItemType.Layer
      };
    });
    this.store.state.updateMany(currentItems, { added: true }, true);
    if (this.catalog && this.catalog.sortDirection !== undefined) {
      this.store.view.sort({
        direction: this.catalog.sortDirection,
        valueAccessor: (item: CatalogItem) => item.title
      });
    }
    this.watcher = new EntityStoreWatcher(this.store, this.cdRef);

  }
github infra-geo-ouverte / igo2-lib / demo / src / app / common / entity-table / entity-table.component.ts View on Github external
: 'radiobox-blank';
        },
        renderer: EntityTableColumnRenderer.Icon
      },
      {
        name: 'id',
        title: 'ID'
      },
      {
        name: 'name',
        title: 'Name'
      },
      {
        name: 'description',
        title: 'Description',
        renderer: EntityTableColumnRenderer.HTML
      },
      {
        name: 'action',
        title: '',
        valueAccessor: (entity: object) => {
          return [{
            icon: 'home',
            color: 'warn',
            click: (row) => { console.log(row); }
          }] as EntityTableButton[];
        },
        renderer: EntityTableColumnRenderer.ButtonGroup
      }
    ]
  };
github infra-geo-ouverte / igo2-lib / demo / src / app / geo / workspace / workspace.component.ts View on Github external
}
    }
  });

  public view = {
    center: [-72, 47.2],
    zoom: 5
  };

  public workspaceStore = new WorkspaceStore([]);

  public selectedWorkspace$: Observable;

  public actionbarMode = ActionbarMode.Dock;

  public scrollBehavior = EntityTableScrollBehavior.Instant;

  constructor(
    private languageService: LanguageService,
    private dataSourceService: DataSourceService,
    private layerService: LayerService
  ) {}

  ngOnInit() {
    this.selectedWorkspace$ = this.workspaceStore.stateView
      .firstBy$(
        (record: EntityRecord) =&gt; record.state.selected === true
      )
      .pipe(
        map((record: EntityRecord) =&gt; {
          return record === undefined ? undefined : record.entity;
        })
github infra-geo-ouverte / igo2-lib / demo / src / app / common / table / table.component.ts View on Github external
name: 'name',
        title: 'Name',
        sortable: true,
        filterable: true
      },
      {
        name: 'description',
        title: 'Description',
        sortable: true,
        filterable: true
      }
    ],
    actions: [
      {
        icon: 'file-document',
        color: TableActionColor.primary,
        click: row => this.showName(row.name)
      }
    ],
    selectionCheckbox: true
  };

  constructor(private languageService: LanguageService) {}

  ngOnInit() {
    this.database = new TableDatabase([
      { id: '2', name: 'Name 2', description: 'Hello 2' },
      { id: '1', name: 'Name 1', description: 'Bonjour 1' },
      { id: '3', name: 'Name 3', description: 'Hola 3' }
    ]);
  }
github infra-geo-ouverte / igo2-lib / demo / src / app / common / table / table.component.ts View on Github external
ngOnInit() {
    this.database = new TableDatabase([
      { id: '2', name: 'Name 2', description: 'Hello 2' },
      { id: '1', name: 'Name 1', description: 'Bonjour 1' },
      { id: '3', name: 'Name 3', description: 'Hola 3' }
    ]);
  }