Skip to content

Commit ea6ab01

Browse files
authored
Merge pull request #272 from performant-software/feature/atlas14_bounding_box
Atlas #14 - Bounding box
2 parents 169abd0 + 20f5ede commit ea6ab01

File tree

9 files changed

+37
-18
lines changed

9 files changed

+37
-18
lines changed

packages/controlled-vocabulary/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/controlled-vocabulary",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",
@@ -23,8 +23,8 @@
2323
"underscore": "^1.13.2"
2424
},
2525
"peerDependencies": {
26-
"@performant-software/semantic-components": "^2.1.0",
27-
"@performant-software/shared-components": "^2.1.0",
26+
"@performant-software/semantic-components": "^2.1.1",
27+
"@performant-software/shared-components": "^2.1.1",
2828
"react": ">= 16.13.1 < 19.0.0",
2929
"react-dom": ">= 16.13.1 < 19.0.0"
3030
},

packages/core-data/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/core-data",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A package of components used with the Core Data platform.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",
@@ -38,9 +38,9 @@
3838
"underscore": "^1.13.2"
3939
},
4040
"peerDependencies": {
41-
"@performant-software/geospatial": "^2.1.0",
42-
"@peripleo/maplibre": "^0.5.1",
43-
"@peripleo/peripleo": "^0.5.1",
41+
"@performant-software/geospatial": "^2.1.1",
42+
"@peripleo/maplibre": "^0.5.2",
43+
"@peripleo/peripleo": "^0.5.2",
4444
"react": ">= 16.13.1 < 19.0.0",
4545
"react-dom": ">= 16.13.1 < 19.0.0"
4646
},

packages/core-data/src/components/SearchResultsLayer.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,37 @@ const SearchResultsLayer = (props: Props) => {
3939
const hits = useCachedHits();
4040
const map = useMap();
4141

42+
/**
43+
* Memo-ize the Typesense hits as a feature collection.
44+
*
45+
* @type {unknown}
46+
*/
4247
const data = useMemo(() => !_.isEmpty(hits) && TypesenseUtils.toFeatureCollection(hits), [hits]);
4348

4449
/**
4550
* Here we'll implement our own fitting of the bounding box once the search has completed and the map has loaded,
4651
* rather than using the default implementation in LocationMarker that will change when the "data" prop changes.
4752
*/
53+
const boundingBoxDependencies = [
54+
data,
55+
mapLoaded,
56+
searchCompleted,
57+
props.boundingBoxData,
58+
props.boundingBoxOptions,
59+
props.buffer,
60+
props.fitBoundingBox
61+
];
62+
4863
useEffect(() => {
49-
if (props.fitBoundingBox && mapLoaded && searchCompleted) {
64+
if (props.fitBoundingBox && data && mapLoaded && searchCompleted) {
65+
// Set the bounding box on the map
5066
const boundingBox = MapUtils.getBoundingBox(data, props.buffer);
5167
map.fitBounds(boundingBox, props.boundingBoxOptions, props.boundingBoxData);
68+
69+
// Reset search completed
70+
setSearchCompleted(false);
5271
}
53-
}, [mapLoaded, searchCompleted, props.boundingBoxData, props.boundingBoxOptions, props.buffer, props.fitBoundingBox]);
72+
}, boundingBoxDependencies);
5473

5574
/**
5675
* Sets the mapLoaded state to true.

packages/geospatial/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/geospatial",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A package of components for all things map-related.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",

packages/semantic-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/semantic-components",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A package of shared components based on the Semantic UI Framework.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",
@@ -35,7 +35,7 @@
3535
"zotero-translation-client": "^5.0.1"
3636
},
3737
"peerDependencies": {
38-
"@performant-software/shared-components": "^2.1.0",
38+
"@performant-software/shared-components": "^2.1.1",
3939
"@samvera/clover-iiif": "^2.3.2",
4040
"react": ">= 16.13.1 < 19.0.0",
4141
"react-dnd": "^11.1.3",

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/shared-components",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A package of shared, framework agnostic, components.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",

packages/user-defined-fields/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/user-defined-fields",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",
@@ -23,8 +23,8 @@
2323
"underscore": "^1.13.2"
2424
},
2525
"peerDependencies": {
26-
"@performant-software/semantic-components": "^2.1.0",
27-
"@performant-software/shared-components": "^2.1.0",
26+
"@performant-software/semantic-components": "^2.1.1",
27+
"@performant-software/shared-components": "^2.1.1",
2828
"react": ">= 16.13.1 < 19.0.0",
2929
"react-dom": ">= 16.13.1 < 19.0.0"
3030
},

packages/visualize/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/visualize",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "A package of components used for data visualization",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",

react-components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"packages/user-defined-fields",
99
"packages/visualize"
1010
],
11-
"version": "2.1.0"
11+
"version": "2.1.1"
1212
}

0 commit comments

Comments
 (0)