Develop custom branches with GeoNode MapStore Client
This section demonstrates how to set up the GeoNode MapStore Client to work on custom branches. It should only take into account the advanced/complex changes that the previously described customization could not support
Build the client to make it available in a static directory
Create a new branch with
cd /opt/client/geonode-mapstore-client
git checkout -b my_custom_branch
Apply all the changes to the js code, python files, or templates and see the update at http://localhost:8081/
Commit your changes
git commit -m "my custom changes to the project"
Compile your bundle with
npm run compile
The compile process will move all the bundles and static files from geonode-mapstore-client/geonode_mapstore_client/client/
to geonode-mapstore-client/geonode_mapstore_client/static/
Commit the compiled bundle
git commit -m "update client bundle"
You could create a fork from the geonode-mapstore-client github page and then add the remote to your local repository
git remote add {my_fork_name} https://github.com/{my_fork_name}/geonode-mapstore-client
Finally, push your branch to your remote repository
git push {my_fork_name} my_custom_branch
Note {my_fork_name} should be replaced with the name of your fork, usually the username or organization name in github
Update the requirement.txt of the geonode-project
It is now possible to install the custom branch inside the geonode-project by updating the requirement.txt
to point to a specific branch of the django_geonode_mapstore_client. Here is an example:
cd /opt/geonode-project/my_geonode/src
vim requirements.txt
-e git+https://github.com/{my_fork_name}/geonode-mapstore-client.git@my_custom_branch#egg=django_geonode_mapstore_client
cd /opt/geonode-project/my_geonode/src
pip install -r requirement.txt