Search code examples
ironpythonspotfiretibcospotfire-analyst

How to copy Map Chart layers from one Map to another?


My team recently received a new requirement to add 30+ map layers to all of the map charts in our analysis file (total of 12 map visualisations). As you know, each layer needs to be set up correctly one by one (i.e. set Color by, Labels) which takes time and it is error-prone.

My question is, is there a way to copy all of the map layers from one map chart to another? For example, I set up all of the 30 map layers to only 1 map chart and then copy those to the other 11 map charts in the DXP. Would that be possible?

Note: I am trying to find out if the above would be possible with an IronPython script but so far I have not found anything useful.

EDIT: I have tried that simple script but it doesn't seem to be doing anything (no errors are shown as well):

from Spotfire.Dxp.Application.Visuals import * 
from Spotfire.Dxp.Application.Visuals.Maps import * 

srcMap= srcMap.As[VisualContent]() #srcMapis a script parameter
destMap= destMap.As[VisualContent]()#destMapa script parameter

myMapDest = myMap.Layers

Solution

  • After talking to TIBCO, as of today, there is no way to do that. The only workaround that they suggested is adding the layers to only 1 map chart and then duplicate that chart to all of the pages. That is not ideal for us as we'll have to do a "second pass" and adjust the map charts as each map chart has slightly different map layer settings for a specific page.