Skip to content

Commit

Permalink
make sure default file chosen on spatial filter add & make deal with …
Browse files Browse the repository at this point in the history
…marker reference issue when paging
  • Loading branch information
micheal-w-wells committed Sep 21, 2023
1 parent 4d2c759 commit 9cb6274
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions appv2/src/UI/Map/OnHoverActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const OnHoverActivity = (props: any) => {
popupRef?.current?.remove();
return;
} else {
if (row.short_id) {
if (row.short_id && centerPointGeometry !== null) {
popupRef.current?.bindPopup(row?.short_id);
} else {
popupRef.current?.bindPopup(row?.id);
Expand All @@ -53,5 +53,5 @@ export const OnHoverActivity = (props: any) => {
map.panTo(map.unproject(px),{animate: true}); // pan to new center
});

return centerPointGeometry !== null ? <GeoJSON ref={popupRef} key={'asdf'} data={centerPointGeometry} /> : null;
return centerPointGeometry !== null ? <GeoJSON ref={popupRef} key={Math.random()} data={centerPointGeometry} /> : null;
};
18 changes: 12 additions & 6 deletions appv2/src/UI/Overlay/Records/RecordSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const Filter = (props) => {
}
});
}}>
{serverBoundariesToDisplay.map((option) => {
{serverBoundariesToDisplay?.map((option) => {
return (
<option key={option.value + option.label} value={option.value}>
{option.label}
Expand All @@ -298,15 +298,21 @@ const Filter = (props) => {
key={'filterTypeSelect' + props.name}
value={filterTypeInState}
onChange={(e) => {
console.dir(e.target.value);

dispatch({
type: RECORDSET_UPDATE_FILTER,
payload: {
let payload = {
filterType: e.target.value,
setID: props.setID,
filterID: props.id
//operator: e.target.value
} as any

if(e.target.value === 'spatialFilterUploaded'){
payload.filter = serverBoundariesToDisplay[0].value
}

dispatch({
type: RECORDSET_UPDATE_FILTER,
payload: {
...payload
}
});
}}>
Expand Down

0 comments on commit 9cb6274

Please sign in to comment.