Loading bar for local geoJson file upload and geoJsonHash request #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We have the following steps:
FileReader
class, loading bar adjusted with theonprogress
event.XMLHttpRequest
, loading bar adjusted with theonprogress
event.Note that there is also a method implemented in comments using
TransformStream
andfetch
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:
Step 2) with breakpoints: