Skip to content

Commit

Permalink
Fixed bug in tile-clusterer
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Sep 18, 2023
1 parent 7af0f9e commit 0e05fd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/data-provider/db-data-provider/db-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class DbDataProvider implements DataProvider {

return {
total: total.cnt,
features: points.rows as Feature<Point>[]
features: (points.rows as Array<{feature: Feature<Point>}>).map((row) => row.feature)
};
}

Expand Down
11 changes: 7 additions & 4 deletions src/tests/v1/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ describe('/v1', () => {

const result = res.body as {features: Feature<Point>[]};
expect(result.features.length).toEqual(102);

expect(result.features[0].geometry.type).toEqual('Point');
expect(result.features[0].geometry.coordinates).toEqual([53.796540969000034, 24.189215755000077]);
});

describe('Check pagination', () => {
Expand Down Expand Up @@ -104,8 +107,10 @@ describe('/v1', () => {
});
expect(res.statusCode).toEqual(200);

const result = res.body as {features: Feature[]; bounds: Bounds};
const result = res.body as {features: Feature<Point>[]; bounds: Bounds};
expect(result.features.length).toEqual(21);
expect(result.features[0].geometry.type).toEqual('Point');
expect(result.features[0].geometry.coordinates).toEqual([-62.54479907699994, 45.81303025200003]);
expect(result.bounds).toEqual([
[-67.5, 48.92249926375823],
[-56.25, 40.97989806962013]
Expand Down Expand Up @@ -141,9 +146,7 @@ describe('/v1', () => {
[-56.3153175459999, 43.45754888200008]
]);

expect(result.features[0].geometry.coordinates).toEqual([
-61.807710623999924, 45.709262931500064
]);
expect(result.features[0].geometry.coordinates).toEqual([-61.807710623999924, 45.709262931500064]);
});
});
});
Expand Down

0 comments on commit 0e05fd1

Please sign in to comment.