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

Refactoring of Map models, template and APIs and removal of legacy code #468

Open
giohappy opened this issue Nov 8, 2021 · 0 comments
Open
Assignees
Labels

Comments

@giohappy
Copy link
Contributor

giohappy commented Nov 8, 2021

The current model for Map and MapLayer is intricate, confoluted and unnecesseraly complex. It builds on previous models (GPX*) and now we are managing an overly complex bridge between the MapStore config model, the Map and MapLayer models, and the GPX classes.

At the opposite we have the GeoApp model which is an abstract model which jsut provides a "type" information and access to the BaseResource.blob field which is used by MapStore to do itw own things. The blob field (data as called by the API) is completely opaque to GeoNode, and this is how things should be,

On the other side the MapStore config held inside the blob field must be inspected and recreated by GeoNode and the MapStore adapter to extract / provide the additional informations needed by the current Map model, and here we enter the grey area of parsing, and building the blob content.

However, the MapStore client in master doesn't need this, and we don't have legacy views / templates that need the information the we're currently storing inside the Map and MapLayer (and GXP*) models, so most of the bridging performed by the MapStore adapter and the underlying GeoNode methods is probably useless.
Moreover, previous GeoNode functionalities that used these information are not exposed anymore (download of a map, exposing WMS services for a map, etc.).

My proposal is to make the following experiment on the master branch:

  • replace the current Map and MapLayer models with the (extremely) simplified models as above
  • exttend the map API to request and return the MapLayer objects when creating and updating a map
  • move the urls and embed views away to the GeoNode MapStore client
  • remove the hooks from the map API (which references MapstoreAdapterHook by default, which in tun uses the GeoNodeSerializer)
  • remove the Serializer and GeoNode converter modules from the Django MapStore Adapter
  • drop the GXP* classes
  • drop any view, template and util methods regarding the *_embed pages from GeoNode

In the end the MapStore map config should be opaque to GeoNode, as it is for GeoApps. GeoNode will manage its own models, that are required to drive the core functionalities, and will request any third party client to populate those models

@giohappy giohappy added the Epic label Nov 8, 2021
@giohappy giohappy changed the title Refactoring of Map models, template and APIs and drop legacy code Refactoring of Map models, template and APIs and removal of legacy code Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants