Google Maps Shading - iOS

点点圈 提交于 2019-12-11 19:47:36

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4651847/google-maps-shading-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!