New frontend - Significant refactor and restructuring #29
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.
Background
The original impetus for this update was the need to support more and more well location points. It it more meaningful to have real points on the map (not clusters like we had before), and using WMS with the Leaflet BetterWMS plugin just to support basic get feature requests is not the path to long-term success. Thus, a larger overhaul was undertaken.
Changes
This pull request implements an entirely new front-end architecture, even though the appearance of the app has been changed as little as possible.
The index page is replaced with a Svelte component that holds the entire map, panels, and interactivity for the main map viewer. An auxiliary utils.js file constructs all of the layers which are imported into the App component.
OpenLayers has replaced Leaflet so the dependency on
django-leaflet
is removed.pg_tileserv
is now used to serve vector tile layers into the main map. The main motivation for this is to slowly remove the need for an external Geoserver instance, which the app has relied upon from the beginning. Geoserver is not the issue, per se, but having to configure multiple layers and styles there completely independently of this code base is cumbersome and not an approach that scales well. Further, setting a pattern for consumption of vector tiles from the native database provides for much easier interactivity with individual features within the web map interface. These layers are styled using ol-mapbox-style.Implementing
pg_tileserv
means that a small utility (pg_tileserv) must run on the server alongside this app, which reads from the Django-managed database.Wells loading
A bit of work was also performed on the management command that is used to load wells from the DNR database, given that this database has changed locations and has a slightly different schema. Ultimately, more work should be done on this, but wells can now be loaded by county which was the ultimate goal.
Issues closed
#7
Regressions
Some aspects of the original app still need to be re-implemented in the new interface.