Skip to content

Commit ea71d37

Browse files
Merge pull request #1520 from geonetwork/backport/2.8.x/pr-1510
[2.8.x] Merge pull request #1510 from geonetwork/dh-table-view-ogc-api-items-limit
2 parents fa42c51 + 5446adb commit ea71d37

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

libs/feature/dataviz/src/lib/service/data.service.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,15 @@ export class DataService {
235235
})
236236
}
237237

238-
async getItemsFromOgcApi(url: string): Promise<OgcApiRecord[]> {
238+
async getItemsFromOgcApi(
239+
url: string,
240+
limit?: number
241+
): Promise<OgcApiRecord[]> {
239242
const endpoint = new OgcApiEndpoint(url)
240243
return await endpoint.featureCollections
241244
.then((collections) => {
242245
return collections.length
243-
? endpoint.getCollectionItems(collections[0])
246+
? endpoint.getCollectionItems(collections[0], limit)
244247
: null
245248
})
246249
.catch(() => {
@@ -385,7 +388,14 @@ export class DataService {
385388
if (!geojsonUrl) {
386389
return throwError(() => 'ogc.geojson.notsupported')
387390
}
388-
return openDataset(geojsonUrl, 'geojson', undefined, cacheActive)
391+
const urlWithoutLimit = new URL(geojsonUrl)
392+
urlWithoutLimit.searchParams.delete('limit')
393+
return openDataset(
394+
urlWithoutLimit.toString(),
395+
'geojson',
396+
undefined,
397+
cacheActive
398+
)
389399
})
390400
)
391401
}

libs/feature/record/src/lib/state/mdview.facade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class MdViewFacade {
164164
link.accessServiceProtocol === 'ogcFeatures'
165165
) {
166166
return from(
167-
this.dataService.getItemsFromOgcApi(link.url.href)
167+
this.dataService.getItemsFromOgcApi(link.url.href, 1)
168168
).pipe(
169169
map((collectionRecords: OgcApiRecord[]) => {
170170
return collectionRecords &&

0 commit comments

Comments
 (0)