Skip to content

Commit 4df6473

Browse files
authored
Merge pull request #369 from PDOK/fix-url-params-in-ui
fix: url params in search UI
2 parents 4093eb8 + 7dd5416 commit 4df6473

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

viewer/src/app/feature-view/feature-view.component.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
import {
2-
AfterViewInit,
3-
ChangeDetectionStrategy,
4-
Component,
5-
ElementRef,
6-
EventEmitter,
7-
Input,
8-
OnChanges,
9-
Output,
10-
} from '@angular/core'
1+
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, OnChanges, Output } from '@angular/core'
112
import { Feature, Map as OLMap, MapBrowserEvent, Overlay, View } from 'ol'
123
import { FeatureLike } from 'ol/Feature'
134
import { defaults as defaultControls } from 'ol/control'

viewer/src/app/legend-view/legend-item/legend-item.component.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ import { fromExtent } from 'ol/geom/Polygon'
99
import VectorTileLayer from 'ol/layer/VectorTile'
1010
import { Projection } from 'ol/proj'
1111
import VectorTileSource from 'ol/source/VectorTile.js'
12-
import {
13-
exhaustiveGuard,
14-
LayerType,
15-
LegendItem,
16-
MapboxStyle,
17-
MapboxStyleService,
18-
} from '../../shared/services/mapbox-style.service'
12+
import { exhaustiveGuard, LayerType, LegendItem, MapboxStyle, MapboxStyleService } from '../../shared/services/mapbox-style.service'
1913

2014
@Component({
2115
selector: 'app-legend-item',

viewer/src/app/shared/services/feature.service.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,18 @@ export class FeatureService {
8282
) {}
8383

8484
queryFeatures(q: string, searchParams: { [key: string]: number }, crs?: string): Observable<FeatureGeoJSON[]> {
85-
const params = new HttpParams().set('q', q)
85+
let params = new HttpParams().set('q', q)
8686
if (crs) {
87-
params.set('crs', crs)
87+
params = params.set('crs', crs)
8888
}
8989
for (const key in searchParams) {
90-
params.set(`${key}[relevance]`, searchParams[key].toString())
91-
params.set(`${key}[version]`, '1')
90+
params = params.append(`${key}[relevance]`, searchParams[key].toString())
91+
params = params.append(`${key}[version]`, '1')
9292
}
9393
return this.http.get<FeatureCollectionGeoJSON>('search', { params }).pipe(map(res => res.features))
9494
}
9595

9696
getFeatures(url: DataUrl): Observable<FeatureLike[]> {
97-
this.logger.debug('Getfeatures')
9897
this.logger.debug(JSON.stringify(url))
9998
const dataproj = getProj(url.dataMapping.dataProjection)!
10099
this.logger.debug(dataproj.getAxisOrientation()) // Ensure the projection is initialized

0 commit comments

Comments
 (0)