How to use the @igo2/utils.uuid function in @igo2/utils

To help you get started, we’ve selected a few @igo2/utils 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 / feature / shared / feature.utils.ts View on Github external
const geometry = olFormat.writeGeometryObject(olFeature.getGeometry(), {
    dataProjection: projectionOut,
    featureProjection: projectionIn
  });

  if (olLayer) {
    title = olLayer.get('title');
    if (olLayer.get('sourceOptions')) {
      exclude = olLayer.get('sourceOptions').excludeAttribute;
      excludeOffline = olLayer.get('sourceOptions').excludeAttributeOffline;
    }
  } else {
    title = olFeature.get('_title');
  }
  const mapTitle = olFeature.get('_mapTitle');
  const id = olFeature.getId() ? olFeature.getId() : uuid();

  return {
    type: FEATURE,
    projection: projectionOut,
    extent: olFeature.get('_extent'),
    meta: {
      id,
      title: title ? title : mapTitle ? mapTitle : id,
      mapTitle,
      revision: olFeature.getRevision(),
      style: olFeature.get('_style'),
      excludeAttribute: exclude,
      excludeAttributeOffline: excludeOffline
    },
    properties,
    geometry,
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / search / search-sources / reseau-transport-quebec-search-source.ts View on Github external
const shownProperties = {};
    this.allowedProperties.forEach(key => {
      if (properties.hasOwnProperty(key)) {
        const aliasProperty = this.propertiesAlias.filter(f => f.name === key)[0];
        shownProperties[aliasProperty.alias] = properties[key];
      }
    });

    delete properties.id;
    delete properties.recherche;
    delete properties.type;
    delete properties.coord_x;
    delete properties.coord_y;
    delete properties.cote;
    return {
      id: uuid(),
      source: ReseauTransportsQuebecSearchSource._name,
      sourceType: SourceFeatureType.Search,
      order: 1,
      zoomMaxOnSelect,
      type: FeatureType.Feature,
      format: FeatureFormat.GeoJSON,
      title: properties.title,
      titleHtml,
      icon,
      projection: 'EPSG:4326',
      properties: shownProperties,
      geometry: result.geometry,
      extent: result.bbox
    };
  }
}
github infra-geo-ouverte / igo2-lib / packages / context / src / lib / share-map / share-map / share-map.component.ts View on Github external
private buildForm(): void {
    const id = uuid();
    let title = 'Partage ';
    title += this.userId ? `(${this.userId}-${id})` : `(${id})`;
    this.form = this.formBuilder.group({
      title: [title],
      uri: [id]
    });
  }
}
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / datasource / shared / datasources / feature-datasource.ts View on Github external
protected generateId() {
    if (!this.options.url) {
      return uuid();
    }
    const chain = 'feature' + this.options.url;
    return Md5.hashStr(chain) as string;
  }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / filter / shared / ogc-filter.ts View on Github external
public addInterfaceFilter(
    igoOgcFilterObject?,
    geometryName?,
    level = 0,
    parentLogical = 'Or'
  ): OgcInterfaceFilterOptions {
    if (!igoOgcFilterObject) {
      igoOgcFilterObject = { operator: 'PropertyIsEqualTo' };
    }
    const f = {
      propertyName: '',
      operator: '',
      active: '',
      filterid: uuid(),
      begin: '',
      end: '',
      lowerBoundary: '',
      upperBoundary: '',
      expression: '',
      pattern: '',
      wildCard: '*',
      singleChar: '.',
      escapeChar: '!',
      matchCase: true,
      igoSpatialSelector: '',
      geometryName: '',
      geometry: '',
      wkt_geometry: '',
      extent: '',
      srsName: '',
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / filter / shared / ogc-filter.ts View on Github external
private addFilterProperties(
    igoOgcFilterObject: OgcInterfaceFilterOptions,
    fieldNameGeometry,
    active = false
  ) {
    const filterid = igoOgcFilterObject.hasOwnProperty('filterid')
      ? igoOgcFilterObject.filterid
      : uuid();
    const status = igoOgcFilterObject.hasOwnProperty('active')
      ? igoOgcFilterObject.active
      : active;

    return Object.assign(
      {},
      {
        filterid,
        active: status,
        igoSpatialSelector: 'fixedExtent'
      },
      igoOgcFilterObject,
      { geometryName: fieldNameGeometry }
    );
  }
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / datasource / shared / datasources / feature-datasource.ts View on Github external
protected generateId() {
    if (!this.options.url) {
      return uuid();
    }
    const chain = 'feature' + this.options.url;
    return Md5.hashStr(chain) as string;
  }
github infra-geo-ouverte / igo2-lib / packages / common / src / lib / entity / shared / view.ts View on Github external
addFilter(clause: EntityFilterClause): string {
    const id = uuid();
    this.filterIndex.set(id, clause);
    this.filters$.next(Array.from(this.filterIndex.values()));
    return id;
  }