Skip to content

How to create an own guide4you module

Sascha Klemenjak edited this page May 17, 2017 · 1 revision

In case you want to subclass and/or extend the guide4you code and add own controls or layer types to the config files, this can be done like this:

  1. Follow the install instructions on https://github.com/KlausBenndorf/guide4you#how-to-install-and-build-guide4you
  2. create conf folder by copying the contents of conf/simple (or conf/full). mkdir conf && cp node_modules/guice4you/conf/simple/* conf/*
  3. create a MyModule.js file anywhere which extends from Module (https://github.com/KlausBenndorf/guide4you/blob/master/src/Module.js). See the comments in the code to see which methods for control creating and layer creating can be overwritten. For an example see https://github.com/KlausBenndorf/guide4you-module-search/blob/master/src/SearchModule.js
  4. Add the Module to the map in the entry.js file like this: https://github.com/KlausBenndorf/guide4you-module-search/blob/master/conf/entry.js#L44