1

In my iOS app (swift 4) I want to have circle annotations (custom image) of a specific size, but I cannot find anywhere that explains how to fix the size/scale of an annotation regardless of map zoom.

When I zoom out I want them to all be small so you can view a large area without it being too cluttered, but when I zoom in close I don't want them to shrink and reveal the centre of the circle, as they currently do.

Is there any way to define the size of a custom annotation image?

Any help is greatly appreciated...

1 Answers1

1

You can scale it if needed inside viewForAnnotation

annotationView?.transform = CGAffineTransform(scaleX: 0.5, y: 0.5)        
return annotationView
Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
  • annotation still scales with zoom... would some screenshots help? – Liam Ottley Jul 23 '18 at 23:13
  • 1
    @LiamOttley have you found the solution to your problem yet? I'm in the process of applying scalable `MKAnnotations` dependant of of the actual `mapVIew`zoom but all the posts I found on this topic, including the suggested in the link, are way old and with a syntax that I barely understand, let alone update to swift 4. Could you please share your code even if you haven't found the solution yet so that other not experienced learning programmers, as myself, can benefit and learn from it? Many thanks – Vincenzo Mar 07 '19 at 07:40