Skip to content

Commit

Permalink
feat(spatial-fiter): add config
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbeau committed Nov 26, 2019
1 parent de1db79 commit dfe58b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -4,3 +4,7 @@ export interface SpatialFilterThematic {
group?: string;
source?: string;
}

export interface SpatialFilterOptions {
url?: string;
}
10 changes: 7 additions & 3 deletions packages/geo/src/lib/filter/shared/spatial-filter.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';

import { HttpClient } from '@angular/common/http';
import { LanguageService } from '@igo2/core';
import { ConfigService, LanguageService } from '@igo2/core';
import { map } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { Feature } from '../../feature/shared';
Expand Down Expand Up @@ -36,8 +36,12 @@ export class SpatialFilterService {

constructor(
private http: HttpClient,
private languageService: LanguageService
) {}
private languageService: LanguageService,
private configService: ConfigService
) {
this.baseUrl =
this.configService.getConfig('spatialFilter.url') || this.baseUrl;
}

getKeyByValue(object, value) {
return Object.keys(object).find(key => object[key] === value);
Expand Down

0 comments on commit dfe58b8

Please sign in to comment.