Jump to content

Changing the map interactive layer using Iron Python in Spotfire - with example


Mark Lewis 2

Recommended Posts

Hello,

I want to change interactive map layer using an Iron Pyhon script in Spotfire. However the Iron Python Spotfire online reference seems to be incomplete or lacking examples.

Can someone tell me how I might change the interactive layer, with a short Iron Python example?

TIA

Mark

Link to comment
Share on other sites

Try this script, where mymap is the map chart Visualization and layerName is the exact name of the layer you want to make interactive.

from Spotfire.Dxp.Application.Visuals.Maps import * mymap = mymap.As[MapChart]()for layer in mymap.Layers: if layer.Title==layerName: mymap.InteractiveLayerReference=layer

The complete Spotfire API is here:

https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-analyst_api/?topic=html/N_Spotfire_Dxp_Framework_DocumentModel.htm

And there are several resources here:

https://community.spotfire.com/s/article/IronPython-Scripting-in-TIBCO-Spotfire

Link to comment
Share on other sites

  • 6 months later...

While looking for an answer to my question, I came across this post. This is very similar to what I'm trying to achieve. I use this whole loop-through-layers-and-match-on-layername process a lot.

My question is, is there a way to change a layer attribute without looping? If I know the name of the layer, can I set the attribute directly? Something like "mymap.Layers("layerName").IncludeInAutoZoom=True"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...