使用MapKit从没有纬度/经度的RSS提要映射数据

时间:2022-10-12 19:43:02

Having follow the tutorial at http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial/ to integrate the MapKit into my application. However, I want to be able to display an annotation for a dynamic "incident" on the map. Here's where I'm having problems.

跟随教程在http://mithin。在/2009/06/22/使用iphone-sdk- MapKit -frame -tutorial/将MapKit集成到我的应用中。但是,我希望能够在地图上显示动态“事件”的注释。这就是我的问题所在。

Basically my apps an RSS reader, and it downloads everything and saves each item of the feed (as in Story 1, Story 2) as currentItem. The data I want to grab and use to map the annotation can be found under currentItem.title - but I can't seem to get it to work in this tutorial's code or find the right place to put it.

基本上,我的应用程序是RSS阅读器,它下载所有内容并保存提要的每一项(就像在故事1,故事2中那样)。我想要获取并用于映射注释的数据可以在currattribuem下找到。标题-但是我似乎不能让它在本教程的代码中工作或者找到合适的地方放置它。

The RSS feed I'm using doesn't have any latitude/longitude information either - making it even harder.

我正在使用的RSS提要也没有任何纬度/经度信息——这使它更加困难。

Any help would be great - I've been working on this for a couple of days now with still no luck.

任何帮助都是很好的——我已经在这上面工作了几天了,但仍然没有运气。

UPDATE: I'm even considering launching the Google Maps application instead showing the annotation. But this in itself is raising issues. Below is the code I'm using but its throwing errors everywhere.

更新:我甚至考虑启动谷歌映射应用程序,而不是显示注释。但这本身就引发了一些问题。下面是我正在使用的代码,但是它到处都有抛出错误。

NSString *title = currentItem.title;
int zoom = 13;
NSString *stringURL = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@@%1.6f,%1.6f&z=%d", title, zoom];
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

1 个解决方案

#1


0  

In the end I just mapped the title using reverse lookup, and added the country afterwards so results would only be in the country where the address is. Not ideal, but it seems to work OK.

最后,我只使用反向查找映射了标题,然后添加了这个国家,这样结果只会在地址所在的国家。不太理想,但似乎还行。

#1


0  

In the end I just mapped the title using reverse lookup, and added the country afterwards so results would only be in the country where the address is. Not ideal, but it seems to work OK.

最后,我只使用反向查找映射了标题,然后添加了这个国家,这样结果只会在地址所在的国家。不太理想,但似乎还行。