Skip to content

Commit d20eb0b

Browse files
authored
Merge pull request #101 from Dataport/fix/narrower-type
narrow down type for EPSG codes
2 parents b4dd6f3 + 49cee51 commit d20eb0b

8 files changed

Lines changed: 18 additions & 6 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## unpublished
4+
5+
- Fix: Increase type precision of EPSG codes from `string` to `EPSG:${string}`.
6+
37
## 1.0.0
48

59
Initial release.

packages/lib/getFeatures/gazetteer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function getGazetteerFeatures(
2323
version: WFSVersion,
2424
memberSuffix: MemberSuffix,
2525
namespaces: string[],
26-
epsg: string,
26+
epsg: `EPSG:${string}`,
2727
options: AdditionalSearchOptions = {}
2828
): Promise<FeatureCollection> {
2929
let requestUrl = Object.entries(input).reduce(

packages/lib/getFeatures/gazetteer/parse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function parseGazetteerResponse(
1616
response: Response,
1717
memberSuffix: MemberSuffix,
1818
namespaces: string[],
19-
epsg: string,
19+
epsg: `EPSG:${string}`,
2020
title?: string | string[]
2121
): Promise<FeatureCollection> {
2222
return response.text().then((text) => {

packages/lib/getFeatures/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface AdditionalSearchOptions {
1515
/** Adds the possibility to have a 'title' attribute in a GeoJSON Feature */
1616
export interface PolarGeoJsonFeature extends GeoJsonFeature {
1717
/** The projection of the coordinates of the features */
18-
epsg: string
18+
epsg: `EPSG:${string}`
1919
/** Which fieldName to use for display purposes; e.g. used in the AddressSearch for the result list */
2020
title?: string
2121
}

packages/lib/testMountParameters/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## unpublished
4+
5+
- Fix: Test now uses a mock EPSG code instead of an empty string.
6+
37
## 1.2.0
48

59
- Feature: Extend mock state to match current core state type.

packages/lib/testMountParameters/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default (): MockParameters => {
4949
center: null,
5050
components: 1,
5151
configuration: {
52-
epsg: '',
52+
epsg: 'EPSG:12345',
5353
layerConf: [],
5454
namedProjections: [],
5555
layers: [],

packages/types/custom/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## unpublished
4+
5+
- Fix: Increase type precision of EPSG codes from `string` to `EPSG:${string}`.
6+
37
## 1.4.0
48

59
- Feature: Add `MasterportalapiPolygonFillHatch` to `MarkerStyle` as optional fill variant.

packages/types/custom/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export type SearchType = 'bkg' | 'gazetteer' | 'wfs' | 'mpapi'
4444
*/
4545
export interface QueryParameters {
4646
/** Currently used projection of the map */
47-
epsg: string
47+
epsg: `EPSG:${string}`
4848
/** sets the maximum number of features to retrieve */
4949
maxFeatures?: number
5050
// type:mpapi – these are forwarded to the masterportalApi
@@ -570,7 +570,7 @@ export interface MapConfig {
570570
/** if true, all services' availability will be checked with head requests */
571571
checkServiceAvailability?: boolean
572572
/** The epsg code of the projection that the map will use */
573-
epsg: string
573+
epsg: `EPSG:${string}`
574574
/** Configured layers */
575575
layers: LayerConfiguration[]
576576
/** masterportalapi-type layer configuration */

0 commit comments

Comments
 (0)