How to use the @igo2/common.getEntityTitle 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 / 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 / projects / context / src / lib / sidenav / sidenav.component.ts View on Github external
get featureTitle(): string {
    return this.feature ? getEntityTitle(this.feature) : undefined;
  }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / feature / shared / feature.utils.ts View on Github external
export function featureToOl(
  feature: Feature,
  projectionOut: string,
  getId?: (Feature) => EntityKey
): OlFeature {
  getId = getId ? getId : getEntityId;

  const olFormat = new OlFormatGeoJSON();
  const olFeature = olFormat.readFeature(feature, {
    dataProjection: feature.projection,
    featureProjection: projectionOut
  });

  olFeature.setId(getId(feature));

  const title = getEntityTitle(feature);
  if (title !== undefined) {
    olFeature.set('_title', title, true);
  }

  if (feature.extent !== undefined) {
    olFeature.set('_extent', feature.extent, true);
  }

  if (feature.projection !== undefined) {
    olFeature.set('_projection', feature.projection, true);
  }

  const mapTitle = getEntityProperty(feature, 'meta.mapTitle');
  if (mapTitle !== undefined) {
    olFeature.set('_mapTitle', mapTitle, true);
  }
github infra-geo-ouverte / igo2-lib / demo / src / app / geo / query / query.component.ts View on Github external
getTitle(result: SearchResult) {
    return getEntityTitle(result);
  }
}
github infra-geo-ouverte / igo2-lib / packages / context / src / lib / sidenav / sidenav.component.ts View on Github external
get featureTitle(): string {
    return this.feature ? getEntityTitle(this.feature) : undefined;
  }