Google地图着色 - iOS [英] Google Maps Shading - iOS

查看:138
本文介绍了Google地图着色 - iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个城市名单(来自世界各地)。也许达拉斯出现4次,而另一座城市可能出现2次,甚至只出现一次。我想在我的iPhone应用程序中有一张地球地图,根据城市在列表中出现的频率对城市进行阴影处理,使得城市越黑暗,城市列表中出现的次数越多。我可以使用谷歌地图吗?什么会实现这样的事情?我有iOS的经验,并且我为iPhone编写了很多应用程序,但是我从来没有处理过GPS,谷歌地图等。

解决方案你可以使用MapKit(谷歌地图)。在我头顶,你需要编写你自己的 MKAnnotationView 类,它在地图上显示一个自定义的pin,并且 MKAnnotation - (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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆