4

Need to use own imaged markers instead built-in pins. I have several questions. 1. Is it legally? I have a doubt because there is no standard support for markers(pins) with own icon.

  1. How to make a marker with own icon right way? I found the post which actually describe how-to: http://www.arlingtondev.com/thoughts/?p=81. I am a newbie, but it looks like a "crutch", which i do not want to use in my clean code. Could you advise better way? I had a lot of problems while integrate that method and currenlty cannot move and animate icons, that's why decided to ask stackoverflowers.
slatvick
  • 1,207
  • 2
  • 16
  • 25

1 Answers1

4

Yes, you can. Check the MKAnnotationView class, it's specifically designed for that. In fact, MKPinAnnotationView inherits from it. Use the image field to specify an image.

Marco Mustapic
  • 3,879
  • 1
  • 21
  • 20
  • If you want to change the latitude/longitude of the marker, change the coordinate of the related `MKAnnotation`. If you want to offset the image, use the `ceterOffset` field of `MKAnnotationView`. The class reference for `MKMapView` explains the relationship between annotations and annotation views. – Marco Mustapic Jun 23 '09 at 19:10
  • Yeah it helped. Do you know how to update a marker's location without remove-add this marker to mapview, because it updates its real location only after map moves or zoomed. – slatvick Jun 24 '09 at 16:18
  • 2
    I think the only way to update an annotation is to remove it and add it again. – Marco Mustapic Jun 26 '09 at 04:56