MapStore GeoNode project: Plugins?

538 views
Skip to first unread message
Assigned to bovio....@gmail.com by matteo.velludi...@gmail.com

Isa

unread,
Feb 8, 2021, 6:14:39 AM2/8/21
to mapstore-developers
Hello again,

last time I configured the "MapStore Standard project" with the `Project Creation Script`, and it worked fine after your very helpful answer.

This time I have a question about the configuration of the "MapStore GeoNode project".
The installation of the "themes" is working fine. But I built an example plugin that I want to display in the burgermenu, and I also want to display MapStore's plugin "Annotations". Later on other MapStore and more custom plugins.

- In `client/js/jsapi/plugins.js` I am importing MapStore's AnnotationsPlugin and my custom ExamplePlugin and exporting them. I can see both as objects in my console.

- Further on I copied the `localConfig.json` from MapStore and added it to `client/js/apps`. In here I added my plugin "Example" to the "desktop" array.

- In `client/js/apps/gn-app.js` I require `plugins.js` and the copied `localConfig.json`. I might be doing something wrong in here or with the `localConfig.json`?

When compiling with `yarn compile`, I then find a `localConfigon.js` which shows my plugin "Example": `"desktop":["Details","Example",...` in the `static/mapstore/dist` folder. But I can't find my custom plugin "Example" or MapStore's "AnnotationsPlugin" in my MapStore.

It would be wonderful if you can give me an answer about what I'm missing?
I can also send you more details of my files.

Best, Isa




Isa

unread,
Feb 9, 2021, 9:05:19 AM2/9/21
to mapstore-developers
I already made it so far to see my ExamplePlugin in the console just the last configuration steps are missing, I guess?
:-)

ExamplePlugin.jpg

Stefano Bovio

unread,
Feb 15, 2021, 3:59:32 AM2/15/21
to mapstore-...@googlegroups.com
Hello Isa,

the configuration for the geonode-mapstore-project is injected directly inside the django templates instead of a localConfig.json for existing map/layers viewers.
Here you can find some general information about the location of the configurations files -> https://github.com/GeoNode/geonode-mapstore-client#configurations-files.


- In `client/js/jsapi/plugins.js` I am importing MapStore's AnnotationsPlugin and my custom ExamplePlugin and exporting them. I can see both as objects in my console.

From this description the import of your "Example" plugin seems correct and this allow to extend the plugins inside the layer and map viewers


- Further on I copied the `localConfig.json` from MapStore and added it to `client/js/apps`. In here I added my plugin "Example" to the "desktop" array.

You need to copy the configuration file you are interested to override from https://github.com/GeoNode/geonode-mapstore-client/tree/master/geonode_mapstore_client/static/geonode/js/ms2/utils in your geonode-project with the same path.

eg. to add your plugin to the base plugin of geonode

- create a file with the following path
root-project/{project-name}/static/geonode/js/ms2/utils/ms2_base_plugins.js

-  ms2_base_plugins.js should contains previous content plus your new plugin

var MS2_BASE_PLUGINS = {
"desktop": [
// ... other plugins,
{ "name": "Example" }
]
};

- now your plugin should be visible in the map viewer and other pages

as you can see there are different configuration files and they are combined inside the templates,
for example the map_view.html template is importing and merging ms2_base_plugin.js and ms2_map_viewer_plugins.js



- In `client/js/apps/gn-app.js` I require `plugins.js` and the copied `localConfig.json`. I might be doing something wrong in here or with the `localConfig.json`?

you don't need gn-app if you want to only override plugins.
gn-app is a placeholder to create a new app to add to custom template in a geonode-project so I think you can remove it in this case.

hope this helps,
Regards,

Stefano



--
You received this message because you are subscribed to the Google Groups "mapstore-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-develo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mapstore-developers/8e975654-4b7a-4bf7-b97b-54c64e64f109n%40googlegroups.com.


--

Regards,

Stefano Bovio

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.

==

Stefano Bovio

Digital Cartographer - UI/UX Designer


GeoSolutions S.A.S.

Via di Montramito 3/A

55054  Massarosa (LU)

Italy

phone: +39 0584 962313

fax:     +39 0584 1660272


http://www.geo-solutions.it

http://twitter.com/geosolutions_it


-------------------------------------------------------


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Isa

unread,
Feb 23, 2021, 8:07:37 AM2/23/21
to mapstore-developers
Thanks Stefano,
now both, my Example plugin and Mapstore's Annotations plugin is showing up in the BurgerMenu.

I added the "utils" folder with adding both plugins to "ms2_base_plugins.js" in my MapStore GeoNode project (based on the script https://github.com/geosolutions-it/mapstore-project/blob/master/types/geonode/README.md), with the same path as you suggested.

Annotations plugin works so far, only I got to find out how my Example plugin will open from the BurgerMenu. I'll have a deeper look into my plugin.

Your answer was very helpful!
Isa
Message has been deleted

Stefano Bovio

unread,
May 6, 2021, 8:22:38 AM5/6/21
to mapstore-...@googlegroups.com
Hello Lisa,

I am actually working on developping a mapstore plugin , and i am trying to activate the annotations tool , but i still don't really know how exctly to do it
I wish that there is someone who can explain to me what i have to do exactly for activating it

if you are trying to add a plugin inside the geonode-mapstore-client  you need to:

- fork the geonode-mapstore-client and create a branch https://github.com/GeoNode/geonode-mapstore-client#customization-via-forkbranch-advanced
- import the plugin inside the list of the available plugins in this case the Annotation plugin https://github.com/GeoNode/geonode-mapstore-client/blob/2.1.x/geonode_mapstore_client/client/js/plugins/index.js
- configure the plugin in localConfig.json to make it available inside the page you need https://github.com/GeoNode/geonode-mapstore-client/blob/2.1.x/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json#L518-L2397. There are various configuration objects divided by pages: eg. "map_edit" list all the plugin for the map viewer in edit mode

Two notes:
- some plugins of MapStore such as Annotation are not currently included because they could not be fully supported in a GeoNode context
and they will probably need some adjustment to work as expected in geonode-mapstore-client
- the steps described above are referred to the current stable branch 2.1.x used in the stable branch 3.2.x of GeoNode
because the master branch of geonode-mapstore-client will introduce new changes in the client structure and configuration.
That said the methodology to include and configure a plugin should remain similir.

Hope this could help,
Regards,

Stefano


Il giorno mar 4 mag 2021 alle ore 09:48 lammour <ammou...@gmail.com> ha scritto:
Hello evryone

I am actually working on developping a mapstore plugin , and i am trying to activate the annotations tool , but i still don't really know how exctly to do it
I wish that there is someone who can explain to me what i have to do exactly for activating it

It would be wonderful if someone assists me on that
Thank you all

Best,

Lisa
--
You received this message because you are subscribed to the Google Groups "mapstore-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-develo...@googlegroups.com.

Lisa Ammour

unread,
May 11, 2021, 5:39:21 AM5/11/21
to mapstore-...@googlegroups.com

Thank you for your answer, 
But as i am a fresh new developper in the domain , i wish that you can give me an example of plugin or explain to me precisly how can a i make a plugin?
I am brand new in the domain so i don’t really know how to start this and create the plugin. 

Thank you
Bests 


Lisa
You received this message because you are subscribed to a topic in the Google Groups "mapstore-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mapstore-developers/bmM6T-RrjKU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mapstore-develo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mapstore-developers/CAFpUycR4bv1CSZ09RKKx0AMAKAV4dRGAqPX4kU9eFTsErN%3Dopw%40mail.gmail.com.

Isa

unread,
May 12, 2021, 4:54:48 AM5/12/21
to mapstore-developers
Hello Lisa,

I watched this two Webinar Videos about Developing with MapStore.
In the middle of Session 2 is an example on how to develop a plugin.
They're from GeoSolutions Group where you can also find more information about their latest releases.

I hope it's helpful to you,
Isa
Reply all
Reply to author
Forward
0 new messages