Hi All,
I am trying to get X,Y coordinates from point feature object. I ran a query on FeatureLayer and got individual feature from FeatureQueryResult.
I can see geometry property in feature object but couldn't find X,Y values.
Is there any way to extract x,y values from feature service or feature object?
Any help would be appreciated.
Regards,
Prashant
Solved! Go to Solution.
You need to cast the geometry to a MapPoint
var mapPoint = (MapPoint)feature.Geometry; //assumes we know it is a point
double x = mapPoint.X;
double y = mapPoint.Y
You need to cast the geometry to a MapPoint
var mapPoint = (MapPoint)feature.Geometry; //assumes we know it is a point
double x = mapPoint.X;
double y = mapPoint.Y