Multiple webgpsmap improvements#1249
Open
jacopotediosi wants to merge 1 commit into
Open
Conversation
This commit is a nearly complete rewrite of the webgpsmap plugin frontend to improve responsible design on mobile devices and usability and performance even with hundreds of thousands of markers on the map. In detail, the following changes have been made: - updated javascript libraries - improved screen space management and responsive design (rewriting the html code in modern HTML5 using flexbox correctly) - calibrated layers max zoom and markerClusterGroup settings to improve map usability based on the Access Point marker size - the search field now shows an X button to clear the field in browsers that support it (e.g. Chrome) - added first seen and last seen dates for each AP on the map - added scale to the map - implemented current location via leaflet-locatecontrol library (only in secure contexts) - added offline map download button - various tricks to improve performance in the case of maps with numerous APs (use of template literals, reduced complexity in creating and applying search filter, ...) - improved code readability and general refactor (e.g., better subdivision into functions, removed unused or useless code, improved indentation, updated comments, moved variables as much as possible inside their scope)
9 tasks
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR is a nearly complete rewrite of the webgpsmap plugin frontend to improve responsible design on mobile devices and usability and performance even with hundreds of thousands of markers on the map.
In detail, the following changes have been made to webgpsmap:
Motivation and Context
The map from the webgpsmap plugin was outdated and the last update was years ago.
The JavaScript libraries used were several versions behind.
The usability on mobile was not optimal (for example, the lack of definition of the viewport caused small texts). Various graphic errors were evident even to the naked eye (texts not centered vertically, the filter bar overlapped the map, ...).
Below are the screenshots of how the old map looked and how the new one looks. The graphical differences may not be so obvious in these screenshots, but behind the scenes it changes a lot.
Old:

New:

How Has This Been Tested?
I have been testing the code for this PR for two weeks in my pwnagotchi instance.
I also measured the performance (empirically) of the new code compared to the old one:
console.time('A');andconsole.timeEnd('A');statements at the start and the end of thedrawPositions()functiondrawPositions()functionHere are the times I measured:
Types of changes
Checklist:
git commit -s