wegue-oss / wegue

Template and components for webmapping applications with OpenLayers and Vue.js
BSD 2-Clause "Simplified" License
97 stars 41 forks source link

Describe how to add a custom module to Wegue #265

Closed JakobMiksch closed 2 years ago

JakobMiksch commented 3 years ago

I got the hint that there is no sufficient description for new users how to include a custom module into the application.

chrismayer commented 2 years ago

Or a script creating a module stub could also be an option.

fschmenger commented 2 years ago

Here are my 3 cents on the topic.

First of all I think we need an anchor for documenting reusable components / Wegue API - as all the documentation so far is mostly app-config related. My proposal would be to introduce something like reusable-components.md. We can then use this as the anchor for e.g. ModuleCard or MapOverlay documentation (see #269). Also all the Wegue templates (AppTemplate, AppFooter etc.) with their respective customization options and slots might go in there.

I totally agree that we need a good concept on providing code examples for all those components. IMO adding further code to the app-starter folder for demonstration purpose is not a great solution. This will overload the templates on the long run, which are primarily used for bootstrapping your application. What do you think about refactoring things in the following way:

- wegue
 - app-starter
 - examples
    - projected
    - sidebar
    - custom_module
    - map_overlay
    - vector layer configuration examples ... 
    - further stuff ...

I propose to resemble the folder structure we have under app-starter for all the specific examples. app-starter itself will be stripped down to only contain a single app-conf (maybe even just the minimal one?!). All specific static resources (e.g. shops-dannstadt.geojson, 2012_Earthquakes_Mag.kml, etc.) will be moved to the respective examples they are used for. Then a user could run the examples e.g. by an app-init script in a similar fashion like we do now. Quite a bunch of work but probably more future proof :)