Google地图着色 - iOS [英] Google Maps Shading - iOS
问题描述
MKAnnotationView
类,它在地图上显示一个自定义的pin,并且 MKAnnotation $ c $你可能需要重载 - (id)initWithAnnotation:将频率(城市出现的次数)传递给视图。在您的自定义 MKAnnotationView
中设置,并设置 / code>基于您的自定义 MKAnnotation
类中存储城市频率的 NSInteger
属性。
Let's say I have a list of cities (from around the world). Perhaps "Dallas" shows up 4 times whereas another city might show up 2 times, or even just once. I'd like to have a map of the globe in my iPhone application where cities are shaded according to how often they appear in the list such that the darker the city is, the more times it shows up on the list of cities. Can I use google maps for this? What would achieving something like this consist of? I have experience with iOS and I've written many applications for the iPhone, but I've never dealt with GPS, google maps, etc.
You could use MapKit (Google Maps) for this. Off the top of my head you would need to code your own MKAnnotationView
class that displays a custom pin on the map and a MKAnnotation
class to pass frequency (times the city shows up) data to the view.
You would need to override - (id)initWithAnnotation:(id <MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier
in your custom MKAnnotationView
and set the image
based on the NSInteger
property in your custom MKAnnotation
class that stores the frequency for the city.
这篇关于Google地图着色 - iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!