2010-10-27 65 views
0

我正在使用JSON iPhone框架v2.3.1,並且想要查詢有關商店,酒店等的Google地圖。可以創建一個URL向我列出一個列表方向?使用JSON向Google Maps詢問商店

其實我正在使用這個Objective C代碼。

- (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"]; 

    //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]; 
} 

感謝您的閱讀。

回答

0

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

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

檢查spatial search

另外,如果您想要實施對商店列表的搜索,那麼您可以考慮使用Google的我的地圖功能。您可以上傳商店列表並搜索特定列表。

+0

嗨約瑟夫圖拉,感謝您的迴應。我已經閱讀過你鏈接到我的文檔。無論如何,我無法找到他們談論我談論的查詢的位置,查詢返回多個結果。 – 2010-10-27 19:35:43

+0

編輯我的答案。請檢查是否可以幫助你。 – 2010-10-27 19:56:15

+0

無論如何,我認爲最好的選擇是使用Google Places。 – 2010-11-01 20:14:41