Add Bookmarks plugins

27 views
Skip to first unread message

Aya Ashraf

unread,
Jun 25, 2019, 4:47:35 AM6/25/19
to mapstore-developers
Hello, 

i'm using mapstore2 for my project but i need to add bookmarks feature to the app, users can add bookmark of a certain view and save it. 
how can i achieve this?
i have already created the sample plugins in the documentation, but i want it to be consistent with the original mapstore .. 

Mauro Bartolomeoli

unread,
Jun 25, 2019, 6:37:19 AM6/25/19
to mapstore-...@googlegroups.com
Hi Aya,
if you only need to bookmar the current view (center and zoom), we have something similar in the Share plugin:

image.png

The "Add bbox param to sharing link" creates a link with the current view of the opened map What you probably need is a way to save this link with a bookmark name and then save / restore the user bookmarks.
Is this describing what you are looking for?

Mauro


--
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 post to this group, send email to mapstore-...@googlegroups.com.
Visit this group at https://groups.google.com/group/mapstore-developers.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mapstore-developers/f39508f2-d56d-4ca7-bd77-687c6589a735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Regards,

Mauro Bartolomeoli

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

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
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.


Aya Ashraf

unread,
Jun 26, 2019, 8:38:17 AM6/26/19
to mapstore-developers
Thank you fro the fast reply.

actually i'm trying to have map preview like the one in the print modal beside each bookmark .
this generated bbox link is good , i was thinking of saving the view object to the store and move the map to it by actions .

how can i get the map preview dialog ? the code is a little bit complicated to me

Mauro Bartolomeoli

unread,
Jun 26, 2019, 10:46:59 AM6/26/19
to mapstore-...@googlegroups.com
Hi Aya,

Il giorno mer 26 giu 2019 alle ore 14:38 Aya Ashraf <a...@cartologic.com> ha scritto:
Thank you fro the fast reply.

actually i'm trying to have map preview like the one in the print modal beside each bookmark .
this generated bbox link is good , i was thinking of saving the view object to the store and move the map to it by actions .


I think this is a good approach. The zoomToPoint action can be used to zoom to a specific point and zoom (https://github.com/geosolutions-it/MapStore2/blob/6e94af4f788214e07f618f999c9ec2b8cbc3db5d/web/client/actions/map.js#L44). You have to save those from the current state when creating the bookmark, and invoke the action with the saved info later.
 
how can i get the map preview dialog ? the code is a little bit complicated to me

The mappreview is indeed complicated, but at the end is just another map component with some interactions blocked and a different size.
To create something similar for your bookmarks you could save together with the center and zoom some info about the layers you want to show in the thumbnail map. You have two options: save also info from the layers state, or just use a static list of layers for the thumbnail (e.g. OSM).
That said, it's not trivial, so if you are not able to do it yourself I suggest you to evaluate our commercial support.

Mauro

Reply all
Reply to author
Forward
0 new messages