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

Loading bar for local geoJson file upload and geoJsonHash request #13

Open
wants to merge 9 commits into
base: Grandro-submit-menu
Choose a base branch
from

Conversation

Grandro
Copy link
Collaborator

@Grandro Grandro commented Jul 18, 2024

This implements a loading bar in the same fashion as the already existing general loading bar to display progress when uploading a geoJson file to the browser and sending the contents to the server.
image

We have the following steps:

  1. The user selects a file to upload.
  2. The file content is read using the FileReader class, loading bar adjusted with the onprogress event.
  3. The read content is sent to the server to retrieve a geoJsonHash using XMLHttpRequest, loading bar adjusted with the onprogress event.
  4. The frontend asks for the result using the obtained hash, the general loading bar shows up.

Note that there is also a method implemented in comments using TransformStream and fetch which I couldn't get to work. Also note that the width of the loading bar and the displayed percentage sometimes don't match during step 2). If I set a breakpoint in the debugger of my browser after the percentage and width has been altered, it does match. If someone has an idea why this could be happening I would gladly appreciate a hint.

Step 2) without breakpoints:
image
Step 2) with breakpoints:
image
image

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.

1 participant