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

New frontend - Significant refactor and restructuring #29

Merged
merged 11 commits into from
Dec 8, 2022

Conversation

mradamcox
Copy link
Contributor

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.

  • Previous: Bootstrap, jQuery, Leaflet (django-leaflet), and Geoserver
  • Current: Svelte, OpenLayers, and pg_tileserv
    • Geoserver is still used for a number of WMS layers, though they will ultimately be moved into pg_tileserv for the vectors and Titiler (or COG/GeoTIFF layers) for the rasters.

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.

  1. Sink evaluation: The original form has been mimicked, but the logic to actually update the database content from the webmap must be recreated.
  2. Right-click on map no longer shows the lat/long of the location, and a link to google maps (see: https://github.com/legiongis/karstography/blob/v0.0.1/cspkarst/static/js/karstmap.js#L146)
  3. The current count of POSSIBLE and PROBABLE sinkholes needs to be added. This is a little trickier than it should be because the layer legend items are defined in the utils.js functions, not directly in the Svelte component.
  4. The ability to update the location of a well needs to be recreated. It was never really used before, but the code to support it is clearly there.

@mradamcox mradamcox merged commit a6ab48b into master Dec 8, 2022
@mradamcox mradamcox deleted the new-frontend branch December 8, 2022 05:59
@mradamcox mradamcox restored the new-frontend branch December 8, 2022 05:59
@mradamcox mradamcox deleted the new-frontend branch December 8, 2022 15:09
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