2

please take a look on this link

http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm.

where the use taps on some locations and that forms a polygon.you can see the area covered by the polygon in output. I want same thing to be achieved in iOS through map kit. currently i am using the following simple code to get touched coordinates on map view . I am unable to get much idea to that. please provide any sample links or code

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (!self.isDrawingPolygon)
        return;

    UITouch *touch = [touches anyObject];
    CGPoint location = [touch locationInView:self.mapView];
    CLLocationCoordinate2D coordinate = [self.mapView convertPoint:location toCoordinateFromView:self.mapView];

    [self addCoordinate:coordinate replaceLastObject:YES];
}
MuraliMohan
  • 1,063
  • 1
  • 11
  • 30

0 Answers0