diff --git a/projects/geo/src/lib/datasource/shared/datasources/datasource.interface.ts b/projects/geo/src/lib/datasource/shared/datasources/datasource.interface.ts index 287f413f9c..d00ccebaa5 100644 --- a/projects/geo/src/lib/datasource/shared/datasources/datasource.interface.ts +++ b/projects/geo/src/lib/datasource/shared/datasources/datasource.interface.ts @@ -20,7 +20,6 @@ export interface DataSourceOptions { // alias?: string; // view?: ol.olx.layer.ImageOptions; - // displayField?: string; ol?: olSource; sourceFields?: SourceFieldsOptionsParams[]; download?: DownloadOptions; diff --git a/projects/geo/src/lib/query/shared/query.directive.ts b/projects/geo/src/lib/query/shared/query.directive.ts index 03688eaf02..90855d6e64 100644 --- a/projects/geo/src/lib/query/shared/query.directive.ts +++ b/projects/geo/src/lib/query/shared/query.directive.ts @@ -106,15 +106,16 @@ export class QueryDirective implements AfterViewInit, OnDestroy { title = this.map.layers.filter(f => f.zIndex === layerOL.getZIndex())[0] .options.title; } - let displayFieldValue = ''; + let queryTitleValue = ''; if ( - layerOL.get('displayField') && - featureOL.getProperties().hasOwnProperty(layerOL.get('displayField')) + layerOL.get('sourceOptions').queryTitle && + featureOL.getProperties().hasOwnProperty(layerOL.get('sourceOptions').queryTitle) ) { - displayFieldValue = - ' (' + featureOL.getProperties()[layerOL.get('displayField')] + ')'; + title = ''; + queryTitleValue = + featureOL.getProperties()[layerOL.get('sourceOptions').queryTitle]; } - featureOL.set('clickedTitle', title + displayFieldValue); + featureOL.set('clickedTitle', title + queryTitleValue); return featureOL; } } diff --git a/projects/geo/src/lib/search/search-sources/reseau-transport-quebec-search-source.ts b/projects/geo/src/lib/search/search-sources/reseau-transport-quebec-search-source.ts index 476d00e5d8..670cad50a4 100644 --- a/projects/geo/src/lib/search/search-sources/reseau-transport-quebec-search-source.ts +++ b/projects/geo/src/lib/search/search-sources/reseau-transport-quebec-search-source.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { Observable, empty } from 'rxjs'; +import { Observable, of } from 'rxjs'; import { ConfigService } from '@igo2/core'; import { map } from 'rxjs/operators'; import { @@ -58,7 +58,7 @@ export class ReseauTransportsQuebecSearchSource extends SearchSource { search(term?: string): Observable { term = term.replace(/auto|routes|route|km| |high|ways|way|roads|road|#|a-|-/gi, ''); let chainage = ''; - if (term.length === 0) { return empty(); } + if (term.length === 0) { return of([]); } if (term.search(/\+/gi ) !== -1) { const split_term = term.split(/\+/gi); term = split_term[0]; @@ -130,7 +130,7 @@ export class ReseauTransportsQuebecSearchSource extends SearchSource { ]; if (typename === '') { - return empty(); + return of([]); } return this.http