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

Configure app with JSON based config #8

Merged
merged 9 commits into from
Apr 13, 2018

Conversation

chrismayer
Copy link
Collaborator

This reworks the application creation in a way that at the startup an application configuration is loaded. The app config is a JSON document, which holds information to influence the initial state of the application, e.g.:

  • Map Center
  • Map Zoom
  • Layers and their Properties
  • Application Title
  • Application Logo URL and Size

This has the advantage that the initial state of the application can be changed without building and deploying the app.

The JSON looks like:

{

  "title": "Vue.js / OpenLayers WebGIS",

  "logo": "https://www.placecage.com/100/100",
  "logoSize": "200",

  "mapZoom": 2,
  "mapCenter": [0, 0],

  "mapLayers": [
    {
      "type": "WMS",
      "lid": "ahocevar-wms",
      "name": "WMS (ahocevar)",
      "format": "image/png",
      "layers": "topp:states",
      "url": "https://ahocevar.com/geoserver/wms",
      "transparent": true,
      "singleTile": false,
      "projection": "EPSG:3857",
      "attribution": "",
      "isBaseLayer": false,
      "visibility": false,
      "displayInLayerList": true
    }
    //...
  ]
}

This adds a factory, which creates OpenLayers layer instances according
to a given config object.
This is a preparation for the upcoming usage of a JSON application config.
Now a JSON app config is loaded, which can be used to influence the
initial state of the application.
This reworks the layer creation, so they are no more modelled in the
WguApp template. Furthermore they are created due to "mapLayers" config
objects within the loaded JSON app config.
This allowes the vector styles and the vector layer selection, which has
been temp. gone due to new app config mechanism.
@chrismayer chrismayer merged commit de60962 into wegue-oss:master Apr 13, 2018
@chrismayer chrismayer deleted the appconfig branch April 13, 2018 13:13
chrismayer added a commit to chrismayer/wegue that referenced this pull request Apr 13, 2018
This removes the OpenLayers layer wrapper classes since they are now
created by a factory (see wegue-oss#8)
justb4 added a commit to Geolicious/wegue that referenced this pull request May 25, 2020
justb4 added a commit to Geolicious/wegue that referenced this pull request May 25, 2020
justb4 added a commit to Geolicious/wegue that referenced this pull request May 25, 2020
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