MapKit 查找最近的位置
我想要完成使用mapKit并代表使用当前位置的任何商店的最近位置的应用程序。如果任何机构有代码,请发布该链接。我可以显示当前位置,但我需要距离函数,它返回某个商店的最近位置有界距离。就像如果我设置 10 英里,它只会显示 10 英里半径区域之间最近的商店。
问候
Haunshila
Ip
i want to done application which use mapKit and represent nearest location of any store using current location..If any body have code for it please post that link.I can show current location but i need distance function which return nearest location of some store in bounded distanc.Like if i set 10 mile it just show nearest store between 10 mile radius of region.
Regards
Haunshila
Ip
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有 google api,您可以通过它显示最近的搜索点..
在这里,您应该传递当前位置的纬度和经度以及搜索关键字(您要搜索的内容)以及您想要的搜索位置数量,您应该将其显示在 UIWebView 中。
请参考下面的代码..
NSString *searchString = @"Hospital";
NSString *tempURLString = [[NSString alloc] initWithFormat:@"http://maps.google.com/maps?q=%@+loc:%f,%f&num=4",searchString,currentUerLocation.coordinate.latitude ,currentUerLocation.坐标.经度];
NSURL *myURL = [NSURL URLWithString:tempURLString];
NSURLRequest *req1= [NSURLRequest requestWithURL:myURL];
[self.myWebView loadRequest:req1];
there are google api's by which you can display the nearest search points..
in this you should pass your current location latitude and longitude and the search key word (what you want to search) and the no.of search locations how many you want, you should display this in UIWebView.
Refer the below code..
NSString *searchString = @"Hospital";
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];