Skip to content

Commit

Permalink
fix(query): restore query result layer index when more than one featu…
Browse files Browse the repository at this point in the history
…res are returned
  • Loading branch information
cbourget committed Apr 16, 2019
1 parent b575461 commit 4f6d5f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/geo/src/lib/measure/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './measure.enum';
export * from './measure.interfaces';
export * from './measure.utils';
6 changes: 5 additions & 1 deletion packages/geo/src/lib/query/shared/query.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ export class QueryService {

return features.map((feature: Feature, index: number) => {
let title = feature.properties[queryDataSource.queryTitle];
title = title ? title : layer.title;
if (!title && features.length > 1) {
title = `${layer.title} (${index + 1})`;
} else if (!title) {
title = layer.title;
}
const meta = Object.assign({}, feature.meta || {}, {
id: uuid(),
title,
Expand Down

0 comments on commit 4f6d5f0

Please sign in to comment.