Jump to content

How can I set an interactive layer on a mapchart in a python script


Luca de Falco 4

Recommended Posts

Hi,How can I set an interactive layer on a mapchart in a python scriptI use this code:

#lay is my layerlay.Enabled="True"

I disable the other layers withlay.Enabled=""It set the layer as visible and as interactive.In a map visualization with 2 layers it works,in an other fail.The layer I want to set is visible,but is not the interactive layer.The interactive layer become the world country layer that I use for geocoding.I hope the problem is clear.

Link to comment
Share on other sites

  • 7 months later...
  • 4 months later...
  • 3 weeks later...

from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers

from Spotfire.Dxp.Application.Visuals import MapChart,CategoricalAxis,ScaleAxis

from Spotfire.Dxp.Application.Visuals import VisualContent

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

from Spotfire.Dxp.Application.Visuals import PositioningMethod, MarkerShape, MarkerType

#The script set a layer as visible and interactive if the right value is selected in the dropdown

#v is a parameter

map=v.As[MapChart]()

#layer 1,dropdown value A

#layer 2,dropdownvalue value B

#dropdownvalue is a parameter

if(dropdownvalue=="A"):

lay=map.Layers.Item[1]

lay.Enabled="True"

map.InteractiveLayerReference=lay=map.Layers.Item[1]

lay=map.Layers.Item[2]

lay.Enabled=""

if(dropdownvalue=="B"):

lay=map.Layers.Item[1]

lay.Enabled=""

lay=map.Layers.Item[2]

lay.Enabled="True"

map.InteractiveLayerReference=lay=map.Layers.Item[2]

Link to comment
Share on other sites

  • 3 years later...
  • 9 months later...

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...