title: iOS Mapkit Annotation Pin Shrinking
body: <p>MapView is pin skrinking everytime. I'm using MKAnnotationView. Can anyone tell what what am I missing here why the pin shrinking? I want to show the pin like that star icon which is also annotation.</p>
  <p>Also everytime I change the current location co-cordinate it will create new pin and old one also be there.</p>
  <pre><code>class CustomPointAnnotation: MKPointAnnotation {
    var imageName: String!
  }
  
      func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -&gt; MKAnnotationView? {
     
      if annotation is MKUserLocation {
             return nil
      }
      
       let annotationView = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: &quot;MyMarker&quot;)
       annotationView.canShowCallout = true
  
       switch annotation.title! {
           case &quot;Your Current Location&quot;:
               annotationView.glyphImage = UIImage(named: &quot;user_location&quot;)
           default:
           annotationView.canShowCallout = true
           annotationView.glyphImage = UIImage(named: &quot;user_location&quot;)
           let buttonPin = UIButton(type: .custom)
           buttonPin.frame = CGRect(x: 0, y: 0, width: 40, height: 40)
           buttonPin.setImage(UIImage(named: &quot;PhoneIcon&quot;), for: .normal)
           annotationView.rightCalloutAccessoryView = buttonPin
           annotationView.markerTintColor = UIColor.purple
       }
       return annotationView
   }
  
    func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
      
      mapView.removeAnnotation(annotation)
      
      let currentLocationValue = manager.location!.coordinate
      let servicelocValue: CLLocationCoordinate2D = CLLocationCoordinate2DMake(coordinates.latitude, coordinates.longitude)
     
      let annotation1 = CustomPointAnnotation()
      annotation1.title = &quot;Your Current Location&quot;
      annotation1.coordinate = currentLocationValue
      annotation1.imageName = &quot;user_location.png&quot;
  
      let annotation2 = CustomPointAnnotation()
      annotation2.title = service ?? &quot;&quot;
      annotation2.subtitle = location
      annotation2.coordinate = servicelocValue
      annotation2.imageName = &quot;user_location.png&quot;
      
      annotations.append(annotation1)
      annotations.append(annotation2)
      
      mapView.addAnnotations(annotations)
      
      mapView.cameraZoomRange = MKMapView.CameraZoomRange(minCenterCoordinateDistance: 50, maxCenterCoordinateDistance: 2000)
      mapView.selectAnnotation(annotation2, animated: false)
  }
  </code></pre>
  <p>}<a href="https://i.stack.imgur.com/pRAHm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pRAHm.jpg" alt="enter image description here" /></a></p>