Set Image Layer Extent from Document Property

# import required classes
from Spotfire.Dxp.Application.Visuals import Maps, MapChart
from Spotfire.Dxp.Application.Visuals import PositioningMethod, MarkerShape, MarkerType

# set visual

# could also do this by passing parameter to the IronPython script
for p in Document.Pages:
    if p.Title == "Defect Overlay":
        for v in p.Visuals:
            if v.Title == "Defect Overlay":
                visual = v
map = visual.As[MapChart]()
i = -1 
for l in map.Layers:
    i = i+1
    if l.Title == "Image Layer":
		myExtent = GeograhpicExtent.Create(Projection.None, 0, mapJointLength, 0, mapCircumference)
		map.Layers.SetExtent(myExtent)

I have a map chart that's using an image with a custom extent that I'd like to change based on a filter. So the filter changes some document properties and when they change the above script is SUPPOSED to set the Extent of the image layer to the document properties. This doesn't work any help would be appreciated. Thanks!

(1) Answer

Login