Skip to content

Commit

Permalink
resolved PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ronitjadhav committed Jan 23, 2024
1 parent e380dde commit 78bfee8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ describe('AddLayerFromWfsComponent', () => {
title: 'Feature Type 1',
url: 'http://my.service.org/wfs',
type: 'wfs',
featureCount: 10000,
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export class AddLayerFromWfsComponent implements OnInit {
name: layer.name,
url: this.wfsUrl.toString(),
type: MapContextLayerTypeEnum.WFS,
featureCount: 10000,
}
this.mapFacade.addLayer({ ...layerToAdd, title: layer.title })
}
Expand Down
1 change: 0 additions & 1 deletion libs/feature/map/src/lib/map-context/map-context.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ interface MapContextLayerWfsModel {
type: 'wfs'
url: string
name: string
featureCount?: number
}

interface LayerXyzModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('MapContextService', () => {
const source = layer.getSource()
const urlLoader = source.getUrl()
expect(urlLoader([10, 20, 30, 40])).toBe(
'https://www.geograndest.fr/geoserver/region-grand-est/ows?service=WFS&version=1.1.0&request=GetFeature&outputFormat=application%2Fjson&typename=ms%3Acommune_actuelle_3857&srsname=EPSG%3A3857&bbox=10%2C20%2C30%2C40%2CEPSG%3A3857'
'https://www.geograndest.fr/geoserver/region-grand-est/ows?service=WFS&version=1.1.0&request=GetFeature&outputFormat=application%2Fjson&typename=ms%3Acommune_actuelle_3857&srsname=EPSG%3A3857&bbox=10%2C20%2C30%2C40%2CEPSG%3A3857&maxFeatures=10000'
)
})
})
Expand Down
12 changes: 6 additions & 6 deletions libs/feature/map/src/lib/map-context/map-context.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export const DEFAULT_VIEW: MapContextViewModel = {
zoom: 2,
}

export const WFS_MAX_FEATURES = 10000

@Injectable({
providedIn: 'root',
})
Expand Down Expand Up @@ -111,12 +113,10 @@ export class MapContextService {
urlObj.searchParams.set('typename', layerModel.name)
urlObj.searchParams.set('srsname', 'EPSG:3857')
urlObj.searchParams.set('bbox', `${extent.join(',')},EPSG:3857`)
if ('featureCount' in layerModel && layerModel.featureCount) {
urlObj.searchParams.set(
'maxFeatures',
layerModel.featureCount.toString()
)
}
urlObj.searchParams.set(
'maxFeatures',
WFS_MAX_FEATURES.toString()
)
return urlObj.toString()
},
strategy: bboxStrategy,
Expand Down

0 comments on commit 78bfee8

Please sign in to comment.