Luca de Falco 4 Posted October 8, 2014 Share Posted October 8, 2014 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 More sharing options...
Manoj Chaurasia Posted October 8, 2014 Share Posted October 8, 2014 Ok thanks, my API documentation was deprecated, thanks to you I have found the updated one. Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted May 13, 2015 Share Posted May 13, 2015 Hi luca, could you please write your code here I really apreciate it. Thanks in advance!! Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted October 2, 2015 Share Posted October 2, 2015 What was your final code Link to comment Share on other sites More sharing options...
Nicolas Stefaniuk Posted October 23, 2015 Share Posted October 23, 2015 Hello. No error It's just that the interactive layer is not the good one Thanks Link to comment Share on other sites More sharing options...
Nicolas Stefaniuk Posted October 23, 2015 Share Posted October 23, 2015 I didn't find the attribut "Enabled" in API documentation. Have you written your code from an example In fact I think they have forgotten to add a method or an attribute for in the API for Interactive Layers, because it has been rebuild in 6.5 Link to comment Share on other sites More sharing options...
Luca de Falco 4 Posted October 23, 2015 Author Share Posted October 23, 2015 I solved. I have to set the property : InteractiveLayerReference Link to comment Share on other sites More sharing options...
Luca de Falco 4 Posted October 23, 2015 Author Share Posted October 23, 2015 Yes,the problems was that the interactive layer was not the good one Link to comment Share on other sites More sharing options...
Luca de Falco 4 Posted October 23, 2015 Author Share Posted October 23, 2015 Enabled is a mapchartlayer property Link to comment Share on other sites More sharing options...
Nicolas Stefaniuk Posted October 23, 2015 Share Posted October 23, 2015 Good job, this property is not referenced in the API. How did you find it Thanks Link to comment Share on other sites More sharing options...
Luca de Falco 4 Posted October 23, 2015 Author Share Posted October 23, 2015 Is referenced in the 6.5 API Enabled is a MapChartDataLayer property InteractiveLayerReferencevis a MapChart property Link to comment Share on other sites More sharing options...
Luca de Falco 4 Posted October 23, 2015 Author Share Posted October 23, 2015 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 More sharing options...
Luca de Falco 4 Posted October 23, 2015 Author Share Posted October 23, 2015 @[user:50870|Ade Eka] a bit late :) Link to comment Share on other sites More sharing options...
Hector Martinez 2 Posted December 6, 2018 Share Posted December 6, 2018 You can use this... from Spotfire.Dxp.Application.Visuals.Maps import MapChart mychart = map.As[MapChart]() for layer in mychart.Layers: # loop through all existing layers if layer.Title=='BOTTOM HOLES': # to find the one you want mychart.InteractiveLayerReference = layer' Link to comment Share on other sites More sharing options...
Charitha Amaraneni Posted September 25, 2019 Share Posted September 25, 2019 Hi LucadF, could you please help me in understanding how you did it Thanks, C Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now