Skip to content

Commit 5bb7247

Browse files
authored
Merge pull request #401 from NickPhura/ACRFD-13
ACRFD-13: feature model update, unused code cleanup.
2 parents 6aaaffc + 5b79a3d commit 5bb7247

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/app/applications/details-panel/details-map/details-map.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ export class DetailsMapComponent implements AfterViewInit, OnDestroy {
7373
// safety check
7474
this.application.features.forEach(f => {
7575
const feature = JSON.parse(JSON.stringify(f));
76-
// needs to be valid GeoJSON
77-
delete feature.geometry_name;
7876
const featureObj: GeoJSON.Feature<any> = feature;
7977
const layer = L.geoJSON(featureObj);
8078
this.appFG.addLayer(layer);

src/app/models/feature.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
// this is the data structure as returned by Tantalis
33
//
44
export class Feature {
5+
id: string;
6+
type: string;
57
geometry: {
68
type: string;
7-
coordinates: any;
9+
geometries: [
10+
{
11+
type: string;
12+
coordinates: any;
13+
}
14+
];
815
};
9-
geometry_name: string;
10-
id: string;
1116
properties: {
1217
CODE_CHR_STAGE: string;
1318
CROWN_LANDS_FILE: string;
@@ -32,13 +37,11 @@ export class Feature {
3237
TENURE_SUBTYPE: string;
3338
TENURE_TYPE: string;
3439
};
35-
type: string;
3640

3741
constructor(obj?: any) {
38-
this.geometry = (obj && obj.geometry) || null;
39-
this.geometry_name = (obj && obj.geometry_name) || null;
4042
this.id = (obj && obj.id) || null;
41-
this.properties = (obj && obj.properties) || null;
4243
this.type = (obj && obj.type) || null;
44+
this.geometry = (obj && obj.geometry) || null;
45+
this.properties = (obj && obj.properties) || null;
4346
}
4447
}

src/app/services/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ export class ApiService {
274274
// Features
275275
//
276276
getFeaturesByTantalisId(tantalisID: number): Observable<Feature[]> {
277-
const fields = ['applicationID', 'geometry', 'geometryName', 'properties', 'type'];
277+
const fields = ['applicationID', 'geometry', 'properties', 'type'];
278278
const queryString = `feature?tantalisId=${tantalisID}&fields=${this.buildValues(fields)}`;
279279
return this.http.get<Feature[]>(`${this.apiPath}/${queryString}`);
280280
}
281281

282282
getFeaturesByApplicationId(applicationId: string): Observable<Feature[]> {
283-
const fields = ['applicationID', 'geometry', 'geometryName', 'properties', 'type'];
283+
const fields = ['applicationID', 'geometry', 'properties', 'type'];
284284
const queryString = `feature?applicationId=${applicationId}&fields=${this.buildValues(fields)}`;
285285
return this.http.get<Feature[]>(`${this.apiPath}/${queryString}`);
286286
}

0 commit comments

Comments
 (0)