-
Notifications
You must be signed in to change notification settings - Fork 94
Lf 3068 when hiding point locations on farm map and zooming out clusters of 0 are shown #3993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: integration
Are you sure you want to change the base?
Conversation
… maxZoom changes - on login and on add new point location
…ap with event listener removal
| const [gMap, setGMap] = useState(null); | ||
| const [gMaps, setGMaps] = useState(null); | ||
| const [gMapBounds, setGMapBounds] = useState(null); | ||
| // Unused: Kept in for map debugging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure about this.
| setShowSuccessHeader(false); | ||
| }; | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling drawAssets twice redraws the cluster twice. MaxZoom triggers this on login (moving from undefined to defined and adding a new point with a different maxZoom values (ocean is easiest) .
| maxZoom, | ||
| ) => { | ||
| // If clusterer is being replaced, remove the old one from the map and cleanup listeners | ||
| if (clustererRef?.current) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If drawAssets() is ever called twice two clusters will be on the map. One would be responsive to filtering, and the other would not be.
Description
In addition to this old bug whose status is released. This also resolves a bug I saw this week where the upon login the point filters on map would appear not to work with clustered points. On refresh that bug would resolve.
This branch fixes the issue twice and does two things:
markerClusterRef.currentto anew MarkerCluster()it first removes the older cluster from the map, and cleans up any listeners before setting the new one. Previously it assumes thatmarkerClusterRef.currentwas yet to be definedLocationPickerJira link: LF-3068
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
In addition to what is outline on the Jira ticket:
Logout method
a. logout and login to farm with clustered points
b. navigate to map and filter that cluster
c. observe number remains the same but zooming in shows items are correctly filtered
d. refresh map, problem does not persist
Add point location method
a. add a new point location to an area that will cause a maxZoom difference (ocean is easiest)
b. filter the cluster
c. observe the number remains the same but zooming in shows items correctly filtered
d. refresh on map, problem does not persist
Checklist:
pnpm i18nto help with this)