Reputation: 31
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
Upvotes: 1
Views: 870
Reputation: 1217
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];
Upvotes: 1