开发者

Using JSON to ask Google Maps for a Shop

I am using the JSON iPhone framework v2.3.1, and I want to query Google Maps about shops, hotels, etc. It is possible to create an URL direction that gives me a list of directions?

Actually I am using this Objective C code.

- (void) searchCoordinatesForAddress {

    //Build the string to Query Google Maps.
    //I don't know how to change this URL direction.
    NSMutableString *urlString = [NSMutableString stringWithFormat:@"http://maps.google.com/maps/geo?q=Paris?output=json"];开发者_如何学JAVA

    //Replace Spaces with a '+' character.
    [urlString setString:[urlString stringByReplacingOccurrencesOfString:@" " withString:@"+"]];

    //Create NSURL string from a formate URL string.
    NSURL *url = [NSURL URLWithString:urlString];

    //Setup and start an async download.
    //Note that we should test for reachability!.
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

    [connection release];
    [request release];
}

Thanks for read.


http://code.google.com/intl/en-EN/apis/maps/index.html

http://code.google.com/intl/es-ES/apis/maps/index.html

Check the spatial search.

Also, if you want to implement a search for stores where you control the list of stores, you might consider using the my maps feature from google. You can upload a list of stores and search that particular list.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜