Index of Selected Vertices

2143
2
Jump to solution
11-13-2012 01:22 PM
JeffGiesler
Occasional Contributor
Hi Everyone,
Does anyone know if there is a way to get the index value of the selected vertex.  What I am trying to do is move the selected vertex to a gps location.  I know I can move it using moveVertexInPart:atIndex:toPoint: and it works for whatever index value I put in but I want it work with the selected vertex and I can't seem to figure out how to get its index.  Any Ideas.
Cheers,
Jeff
0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor
The API doesn't expose the index of the selected vertex.

However, if you would like to move it to the current GPS location, you can programatically simulate a touch on the map, this will make the selected vertex move to the location of the touch.

CGPoint screenPoint = [self.mapView toScreenPoint:self.mapView.gps.currentPoint];                 [self.sketchGraphicsLayer mapView:self.mapView didClickAtPoint:screenPoint mapPoint:self.mapView.gps.currentPoint graphics:[NSDictionary dictionary]];

View solution in original post

0 Kudos
2 Replies
DiveshGoyal
Esri Regular Contributor
The API doesn't expose the index of the selected vertex.

However, if you would like to move it to the current GPS location, you can programatically simulate a touch on the map, this will make the selected vertex move to the location of the touch.

CGPoint screenPoint = [self.mapView toScreenPoint:self.mapView.gps.currentPoint];                 [self.sketchGraphicsLayer mapView:self.mapView didClickAtPoint:screenPoint mapPoint:self.mapView.gps.currentPoint graphics:[NSDictionary dictionary]];
0 Kudos
JeffGiesler
Occasional Contributor
Divesh,
That was a good idea it worked, thanks.  I ended up using didEndTapAndHoldAtPoint instead of didClickAtPoint.  The first one moved the selected vertex while the second add a new while leaving the old one there.  Both are very useful though.  Again thanks for the help.
Cheers,
Jeff
0 Kudos