title: Prevent MKPolygon to have knots
body: <p>I'm developing an app with a map in which the user can draw a polygon area.</p>
  
  <p>My issue is what it's possible drawing polygons with knots (see the image) (I don't know if <em>knot</em> is the right word). I didn't find a simply way preventing the polygon to get knots.
  For the case of the attached image, I would like the small curl to be removed and even the outline to be smoothed</p>
  
  <p>Do you know a way to make that?</p>
  
  <p><img src="https://i.stack.imgur.com/owBS4.png" alt="Polygon with curl"></p>
  
  <p>The process of drawing the polygon while the user is touching the screen, does use <code>MKPolyline</code>, <code>MKPolygon</code> and <code>MKOverlay</code> as follows:</p>
  
  <pre><code>- (void)touchesBegan:(UITouch*)touch
  {
      CGPoint location = [touch locationInView:self.mapView];
      CLLocationCoordinate2D coordinate = [self.mapView convertPoint:location toCoordinateFromView:self.mapView];
      [self.coordinates addObject:[NSValue valueWithMKCoordinate:coordinate]];
  }
  
  - (void)touchesMoved:(UITouch*)touch
  {
      CGPoint location = [touch locationInView:self.mapView];
      CLLocationCoordinate2D coordinate = [self.mapView convertPoint:location toCoordinateFromView:self.mapView];
      [self.coordinates addObject:[NSValue valueWithMKCoordinate:coordinate]];
  }
  
  - (void)touchesEnded:(UITouch*)touch
  {
      CGPoint location = [touch locationInView:self.mapView];
      CLLocationCoordinate2D coordinate = [self.mapView convertPoint:location toCoordinateFromView:self.mapView];
      [self.coordinates addObject:[NSValue valueWithMKCoordinate:coordinate]];
      [self didTouchUpInsideDrawButton:nil];
  }
  
  - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id &lt;MKOverlay&gt;)overlay
  {
      MKOverlayPathView *overlayPathView;
  
      if ([overlay isKindOfClass:[MKPolygon class]])
      {
          // create a polygonView using polygon_overlay object
          overlayPathView = [[MKPolygonView alloc] initWithPolygon:overlay];
          overlayPathView.fillColor   = [UIColor redColor];
          overlayPathView.lineWidth = 1.5;
          return overlayPathView;
      }
      else if ([overlay isKindOfClass:[MKPolyline class]])
      {
          overlayPathView = [[MKPolylineView alloc] initWithPolyline:(MKPolyline *)overlay];
          overlayPathView.fillColor   = [UIColor redColor];
          overlayPathView.lineWidth = 3;
          return overlayPathView;
      }
      return nil;
  }
  </code></pre>