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

Refactor function LayerFactory::get(config = {}) #449

Merged
merged 21 commits into from
Aug 25, 2023
Merged

Conversation

Raruto
Copy link
Collaborator

@Raruto Raruto commented Jul 20, 2023

Motivation

Related to: #456 and #291

Keep all "factory" related code within the same file (while waiting for future refactorings).

List of changes

  • simplify unreadable nested switch -> case -> if -> else -> if logic (related to: ArcGIS Rest Servers bug / feature ? g3w-suite-docker#104)

  • delete folder src/app/core/layers/baselayers/

    • move file: core/layers/baselayers/baselayer into core/layers/baselayer
    • move class: core/layers/baselayers/arcgislayer into core/layers/layerfactory
    • move class: core/layers/baselayers/binglayer.js into core/layers/layerfactory
    • move class: core/layers/baselayers/osmlayer.js into core/layers/layerfactory
    • move class: core/layers/baselayers/tmslayer.js into core/layers/layerfactory
    • move class: core/layers/baselayers/wmslayer.js into core/layers/layerfactory
    • move class: core/layers/baselayers/wmtslayer.js into core/layers/layerfactory
  • convert to ES6 classes:

    • LayerFactory
    • OSMLayer
    • BingLayer
    • TMSLayer
    • ARCGISMAPSERVERLayer
    • WMTSLayer
    • WMSLayer

- simplify nested `switch-if` logic
- convert `LayerFactory`  to ES6 class
@Raruto Raruto added the refactoring Anything which could result in a API change label Jul 20, 2023
@Raruto Raruto added this to the v3.9 milestone Jul 20, 2023
@volterra79
Copy link
Member

volterra79 commented Jul 31, 2023

@Raruto i think we need to move all files into core/layers/map and baselayer.js into g3w-ol folder because are all referred to Openlayers class

@Raruto
Copy link
Collaborator Author

Raruto commented Aug 7, 2023

@volterra79 definitely in an upcoming pull request.. 🫠

@Raruto Raruto merged commit 795b213 into dev Aug 25, 2023
@Raruto Raruto deleted the refactor-layersfactory branch August 25, 2023 13:47
volterra79 added a commit to g3w-suite/g3w-admin that referenced this pull request Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Anything which could result in a API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants