Anotación de pin de image de tamaño

Puse la image personal en lugar del pin rojo tradicional. cuando abro el map para mostrar el pin, la image cubre todo el map. ¿Hay un tamaño máximo de la image del pin o integrar algo en el código para adaptarse al tamaño del pin clásico estándar?

func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { return nil } let annotationIdentifier = "SomeCustomIdentifier" // use something unique that functionally identifies the type of pin var annotationView: MKAnnotationView! = mapView.dequeueReusableAnnotationViewWithIdentifier(annotationIdentifier) if annotationView != nil { annotationView.annotation = annotation } else { annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: annotationIdentifier) annotationView.image = UIImage(named: "pin maps.png") annotationView.canShowCallout = true annotationView.calloutOffset = CGPointMake(-8, 0) annotationView.autoresizesSubviews = true annotationView.rightCalloutAccessoryView = UIButton(type: UIButtonType.DetailDisclosure) as UIView } return annotationView } 

No hay un tamaño máximo de la image del pin. Necesita cambiar el tamaño de UIImage.

  let annotationIdentifier = "SomeCustomIdentifier" var annotationView = mapView.dequeueReusableAnnotationViewWithIdentifier(annotationIdentifier) if annotationView == nil { annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: annotationIdentifier) annotationView?.canShowCallout = true // Resize image let pinImage = UIImage(named: "pin maps.png") let size = CGSize(width: 50, height: 50) UIGraphicsBeginImageContext(size) pinImage!.drawInRect(CGRectMake(0, 0, size.width, size.height)) let resizedImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() annotationView?.image = resizedImage let rightButton: AnyObject! = UIButton(type: UIButtonType.DetailDisclosure) annotationView?.rightCalloutAccessoryView = rightButton as? UIView } else { annotationView?.annotation = annotation }