How to manipulate a map point
I am creating a workflow. I need to be able to add a number to the x and y coordinate of a map point. For example: point.X + 1000.
Is there a way I can set a map point?
0
-
Can't you just make a new variable (type = Double), and set that new variable = point.X + 1000 ? 0 -
Yes I did. I created a variable for map point. Now I am getting an null error. I dont not know how to initialize the map point variable so that it is not null. 0 -
Hi Shaniqua,
Once you have a FeatureSet, you can assign the FeatureSet's geometry to a variable with a Cast<T> activity (Type: ESRI.ArcGIS.Client.Geometry.MapPoint). The input "Value" for that activity (the right side) will be something like this: FeatureSetVariable.Features(0).Geometry. And the output "To" (left side) will be your new variable.
Then, you can use an Assign activity to modify the X and Y and, if required, assign it to a new variable.
Thanks,
Aaron Oxley0 -
In the list of variables you'll find a column named 'Default'. Set this to New MapPoint() to initialize the mappoint, or New MapPoint(100, 200) to also to set initial X and Y values.
Alternatively, use an assign activity where you set value to the name of your variable, and to to New MapPoint().
To change X or Y later, for instance to add 1000 to the X coordinate, you can use an Assign activity with Value: point.X and To: point.X + 1000.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare