Skip to content
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

Fix zoom and panning issues in maps #2378

Merged
merged 8 commits into from
Jul 11, 2024

Conversation

CollinBeczak
Copy link
Collaborator

@CollinBeczak CollinBeczak commented Jul 10, 2024

Resolves: #2376

After completing a task, the map bounds of both the task map widget and work on multiple tasks widget wasn't updating causing it to appear as if there was not data in the next task.

The main issue described was fixed here:

useEffect(() => {
  if (features.length !== 0) {
    const layerGroup = L.featureGroup(
      features.map(feature => L.geoJSON(feature))
    );
    map.fitBounds(layerGroup.getBounds().pad(0.2));
  }
}, [props.taskBundle, props.taskId]);

This re fits the bounds to display the new task in view using the props.taskBundle and props.taskId variables as listeners.

Other modification included in this pr is removing the nowrap attribute from cluster maps.

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 5.55556% with 17 lines in your changes missing coverage. Please review.

Project coverage is 23.49%. Comparing base (cb2ef25) to head (e6d41c0).

Files Patch % Lines
src/components/TaskPane/TaskMap/TaskMap.js 0.00% 13 Missing and 3 partials ⚠️
src/components/TaskClusterMap/MapMarkers.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2378   +/-   ##
=======================================
  Coverage   23.48%   23.49%           
=======================================
  Files         649      649           
  Lines       22503    22498    -5     
  Branches     6941     6940    -1     
=======================================
  Hits         5285     5285           
+ Misses      14405    14402    -3     
+ Partials     2813     2811    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CollinBeczak CollinBeczak marked this pull request as ready for review July 11, 2024 02:55
@CollinBeczak CollinBeczak merged commit e309a2c into main Jul 11, 2024
5 of 6 checks passed
@CollinBeczak CollinBeczak deleted the fix-zoom-and-panning-issues-in-maps branch July 11, 2024 02:55
@CollinBeczak CollinBeczak mentioned this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MR does not display tasks in challenges
1 participant