ios - Custom marker image on swift (MapKit) -


i use custom marker on mapkit

how can change image width , height on custom marker?

my code:

func mapview(mapview: mkmapview!, viewforannotation annotation: mkannotation!) -> mkannotationview! {      if (annotation mkuserlocation) {         return nil     }      let reuseid = "test"      var anview = mapview.dequeuereusableannotationviewwithidentifier(reuseid)     if anview == nil {          anview = mkannotationview(annotation: annotation, reuseidentifier: reuseid)         anview.image = uiimage(named:"x2.png")         anview.canshowcallout = true     }     else {         anview.annotation = annotation     }     return anview } 

try use

anview.frame.size = cgsize(width: 30.0, height: 30.0) 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -