Discussion Forums  >  Uncategorized

Replies: 3    Views: 418

stoneypointe
Apple Fan
Profile
Posts: 162
Reg: Jul 30, 2011
Miami, Florida
1,620
11/07/11 04:21 PM (14 years ago)

IOS 1.5: Replace map pin with an icon

Hi Has anyone tried replaced the pin on a map with an icon? If so, how have you accomplished this? Thanks M
 
stoneypointe
Apple Fan
Profile
Posts: 162
Reg: Jul 30, 2011
Miami, Florida
1,620
like
11/08/11 08:25 PM (14 years ago)
No one? M.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
11/08/11 11:19 PM (14 years ago)
I'll try to write more about this but the idea is.... a) Drag an icon into xcode. b) Change the logic in the BT_screen_map.m file. The idea is that a UIView is created for each pin. When this view is created you'll want to add your own icon instead of the standard colored pins. The method that fires for every location (that produces a pin) is called viewForAnnotation and it starts on line 519. Have a look around line 549, 550, 551 and you'll see where it sets the pin color based on the settings in the control panel. It's here where you'll want to remove those three lines and implement your own UIImageView for the pin. have a look at this for details and syntax. http://shawnsbits.com/blog/2011/04/12/custom-map-pins-for-mapkit/
 
stoneypointe
Apple Fan
Profile
Posts: 162
Reg: Jul 30, 2011
Miami, Florida
1,620
like
11/09/11 06:30 AM (14 years ago)
Thank you David I will give it a try M.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.