How to set Coordinate Columns (longitude, latitude) in an ironpython script?

I'm making a script using IronPython to automate the configuring of a MapChart's properties. I've managed to set the positioning method to longitude latitude, now I need to assign the longitude(X-column)/latitude(Y-column) to columns in my dataset. Ive been digging through the API documentation but can't find a solution. I've attached my current code below.

 

from Spotfire.Dxp.Application.Visuals import * 

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



#v1 is defined in Script Parameters 

map = v1.As[MapChart]() 

#setting scales to be the die size

map.Transform = map.Transform.FromScales(12.7,15.8)

#turning off coordinate system on main chart

map.Projection = Projection.None

#looping through lyrs in V1's "Page > Map"

for lyr in map.Layers: 

 if (lyr.Title == "Map Layer"): 

    lyr.Enabled = False 

 if (lyr.Title != "Map Layer"):

    #turning off coordinate system by layer

    lyr.Projection = Projection.None

    #setting positioning method to Coordinate Columns (longitudelatitude)

    markerLayer = lyr.As[MarkerLayerVisualization]()

    markerLayer.PositioningMethod = PositioningMethod.LongitudeLatitude

    #Setting markerClass to tiled markers

    markerLayer.MarkerClass = MarkerClass.Tile

1 Comment

can I see your CSS? 



You probably need to define the die placement so everything is aligned right

The Grindset - Jul 21, 2021 - 12:29pm
+ Add a Comment

(2) Answers

Login