Lauren Fuller Posted July 19, 2019 Share Posted July 19, 2019 Hi all, I am trying to set up some IronPython code that adds and turns on a feature layer only when a specific marker layer has been selected by the user. My code is below. Error tracebacksays that the file for the new feature layer has not been found. I have checked the file name and it is correct,so I must have something else wrong in the code. Any help will be much appreciated! Thank you! Lauren ## set visualiation as map chart map = visualization.As[MapChart]() ## add new feature layer fl=map.Layers.AddNewFeatureLayer("RR43") ## give new layer a title fl[0].Title="RR43" ## if the title of the markerlayer the user hasselected is "FB" then turn on the new feature layer "RR43" also if (layer.Title == "FB"): fl[0].Enabled=True Link to comment Share on other sites More sharing options...
Lauren Fuller Posted July 19, 2019 Author Share Posted July 19, 2019 Just solved it!for layer in map.Layers: if layer.Title == "RR43": fLayer = layerfor layer in map.Layers: if layer.Title == "FB": fLayer.Enabled = True Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted August 28, 2019 Share Posted August 28, 2019 Just solved it! -------------------------- for layer in map.Layers: if layer.Title == "RR43": fLayer = layer for layer in map.Layers: if layer.Title == "FB": fLayer.Enabled = True ----------------------------- 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