Mapstore Javascript Api

25 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

Francois Vitry

unread,
May 28, 2024, 4:48:04 AMMay 28
to mapstore-developers
Hello there is this action :

MapStore2.triggerAction({
type: "ADD_LAYER",



But how to delete the layer?

Thanks 

Lorenzo Natali

unread,
May 29, 2024, 5:22:49 AMMay 29
to mapstore-developers
Here you can find the actions available 

You can use MapStore2.triggerAction({ type: "REMOVE_LAYER", layerId: "the <id> attribute specified when ADD_LAYER was called"})

Shivendra Das

unread,
May 29, 2024, 9:43:07 AMMay 29
to mapstore-developers
Hi Francois

Below way you can remove layer.


MapStore2.triggerAction({
      type: 'REMOVE_LAYER',
      layerId: layerId
    });

Regards
Shivendra Nath Das

Reply all
Reply to author
Forward
0 new messages