title: How can I make an annotation like maps app has
body: <p>I have an app with map and a lot of annotations that are made with custom image, and my problem is that when i drag the map or zoom the annotation shows another point (lat , lon).</p>
  
  <p>So I was wondering because I see this bug in other applications too, is there any way to fix it (to be as the maps annotation that always shows the right lat and lon).</p>
  
  <p>This is the code I use for annotation: </p>
  
  <pre><code>func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -&gt; MKAnnotationView? {
  
      if annotation is MKUserLocation {
          return nil
      }
  
  
      var reuseId = ""
  
      if annotation is FBAnnotationCluster {
  
          reuseId = "Cluster"
          var clusterView = mapView.dequeueReusableAnnotationView(withIdentifier: reuseId)
          clusterView = FBAnnotationClusterView(annotation: annotation, reuseIdentifier: reuseId, configuration: FBAnnotationClusterViewConfiguration.default())
          return clusterView
      }else{
  
          reuseId = "pin"
          var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: reuseId)
          if  annotationView == nil {
              annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "pin")
              annotationView!.image = UIImage(named: "locat.png")
  
  
          }
          else {
              annotationView!.annotation = annotation
  
          }
  
          let cpa = annotation as! FBAnnotation
  
          annotationView!.image = nil
  
          let image = UIImage(named:cpa.nameImage)
  
  
          annotationView!.image = image
  
  
          return annotationView
      }
  
  
  
  
  }
  </code></pre>
  
  <p>If you have any question about what I'm asking or anything else please feel free to leave a comment.</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I upload it an <a href="https://www.dropbox.com/s/lxlzeey1kv0ipth/Untitled1.mov?dl=0" rel="nofollow noreferrer">video</a> showing my problem </p>
  
  <p><strong>EDIT2</strong></p>
  
  <p>And here is a <a href="https://www.dropbox.com/s/nblo3sh2tw5knw8/Untitled3.mov?dl=0" rel="nofollow noreferrer">video</a> from maps that showing that their annotation is not losing its lat and lon.</p>