我正在创建一个应用程序,其中显示附近的医院,所以如果你知道怎么做,我不能编程吗?
答案 0 :(得分:0)
SKNearbySearchSettings* searchObject = [SKNearbySearchSettings nearbySearchSettings];
searchObject.coordinate = CLLocationCoordinate2DMake(currentLocation.coordinate.latitude, currentLocation.coordinate.longitude);
searchObject.searchTerm=@""; //search for all POIs
searchObject.radius = 5000;
searchObject.searchMode=SKSearchHybrid;
searchObject.searchResultSortType=SKProximitySort;
searchObject.searchCategories = @[ @(SKPOICategoryHospital)];
[[SKSearchService sharedInstance] setSearchResultsNumber:10000];
[[SKSearchService sharedInstance]startNearbySearchWithSettings:searchObject];
使用此代码查找附近的医院。