2011-01-28 64 views
1

我想做的应用程序使用mapKit和代表任何商店使用当前位置最近的位置..如果任何机构有代码它请张贴该链接。我可以显示当前位置,但我需要距离功能返回有限距离内的某个商店的最近位置。如果我设置了10英里,它只显示10英里半径范围内的最近商店。MapKit查找最近的loacation

问候

Haunshila

回答

1

有谷歌的API,通过它可以显示在此的最近的搜索点.. 你应该通过您的当前位置的纬度和经度和搜索键单词(你想要搜索的内容)和你想要的搜索位置的数量,你应该在UIWebView中显示。

参见下面的代码..

的NSString * searchString的= @ “医院”; NSString * tempURLString = [[NSString alloc] initWithFormat:@“http://maps.google.com/maps?q=%@+loc:%f,%f”& num = 4“,searchString,currentUerLocation .coordinate.latitude,currentUerLocation.coordinate.longitude]; NSURL * myURL = [NSURL URLWithString:tempURLString];
NSURLRequest * req1 = [NSURLRequest requestWithURL:myURL]; [self.myWebView loadRequest:req1];

+0

Thanx Chaitanya for feeding – imdhresh 2011-02-02 04:49:03