I am using the MapKit framework to load google maps on my application and I place on map 4 \"simulated\" places like this:
- (void)viewDidLoad {
[super view
Swift 4 and 5:
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
// Check for type here, not for the Title!!!
guard !(annotation is MKUserLocation) else {
// we do not want to return a custom View for the User Location
return nil
}
let identifier = "Identifier for this annotation"
let annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: identifier)
annotationView.image = UIImage(named: "MyMapIcon")
annotationView.frame = CGRect(x: 0, y: 0, width: 25, height: 25)
annotationView.canShowCallout = false
return annotationView
}