You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

375 lines
13 KiB

//
// AMapSearchAPI.h
// AMapSearchKit
//
// Created by xiaoming han on 15/7/22.
// Copyright (c) 2015年 Amap. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AMapSearchObj.h"
#import "AMapCommonObj.h"
@protocol AMapSearchDelegate;
///搜索结果语言
typedef NS_ENUM(NSInteger, AMapSearchLanguage)
{
AMapSearchLanguageZhCN = 0, ///< 中文
AMapSearchLanguageEn = 1 ///< 英文
};
///搜索类
@interface AMapSearchAPI : NSObject
///实现了 AMapSearchDelegate 协议的类指针。
@property (nonatomic, weak) id<AMapSearchDelegate> delegate;
///查询超时时间,单位秒,默认为20秒。
@property (nonatomic, assign) NSInteger timeout;
///查询结果返回语言, 默认为中文。
@property (nonatomic, assign) AMapSearchLanguage language;
/**
* @brief AMapSearch的初始化函数
* key使.
* @return AMapSearch类对象实例
*/
- (instancetype)init;
/**
* @brief
*/
- (void)cancelAllRequests;
#pragma mark - 搜索服务接口
/**
* @brief POI ID查询接口
* @param request AMapPOIIDSearchRequest
*/
- (void)AMapPOIIDSearch:(AMapPOIIDSearchRequest *)request;
/**
* @brief POI
* @param request AMapPOIKeywordsSearchRequest
*/
- (void)AMapPOIKeywordsSearch:(AMapPOIKeywordsSearchRequest *)request;
/**
* @brief POI
* @param request AMapPOIAroundSearchRequest
*/
- (void)AMapPOIAroundSearch:(AMapPOIAroundSearchRequest *)request;
/**
* @brief POI
* @param request AMapPOIPolygonSearchRequest
*/
- (void)AMapPOIPolygonSearch:(AMapPOIPolygonSearchRequest *)request;
/**
* @brief 沿 (v4.3.0)
* @param request AMapRoutePOISearchRequest
*/
- (void)AMapRoutePOISearch:(AMapRoutePOISearchRequest *)request;
/**
* @brief
* @param request AMapGeocodeSearchRequest
*/
- (void)AMapGeocodeSearch:(AMapGeocodeSearchRequest *)request;
/**
* @brief
* @param request AMapReGeocodeSearchRequest
*/
- (void)AMapReGoecodeSearch:(AMapReGeocodeSearchRequest *)request;
/**
* @brief
* @param request AMapInputTipsSearchRequest
*/
- (void)AMapInputTipsSearch:(AMapInputTipsSearchRequest *)request;
/**
* @brief
* @param request AMapBusStopSearchRequest
*/
- (void)AMapBusStopSearch:(AMapBusStopSearchRequest *)request;
/**
* @brief 线
* @param request AMapBusLineIDSearchRequest
*/
- (void)AMapBusLineIDSearch:(AMapBusLineIDSearchRequest *)request;
/**
* @brief 线
* @param request AMapBusLineNameSearchRequest
*/
- (void)AMapBusLineNameSearch:(AMapBusLineNameSearchRequest *)request;
/**
* @brief
* @param request AMapDistrictSearchRequest
*/
- (void)AMapDistrictSearch:(AMapDistrictSearchRequest *)request;
/**
* @brief
* @param request AMapDrivingRouteSearchRequest
*/
- (void)AMapDrivingRouteSearch:(AMapDrivingRouteSearchRequest *)request;
/**
* @brief
* @param request AMapWalkingRouteSearchRequest
*/
- (void)AMapWalkingRouteSearch:(AMapWalkingRouteSearchRequest *)request;
/**
* @brief
* @param request AMapTransitRouteSearchRequest
*/
- (void)AMapTransitRouteSearch:(AMapTransitRouteSearchRequest *)request;
/**
* @brief (since 4.3.0)
* @param request AMapRidingRouteSearchRequest
*/
- (void)AMapRidingRouteSearch:(AMapRidingRouteSearchRequest *)request;
/**
* @brief since 6.1.0
* @param request AMapTruckRouteSearchRequest
*/
- (void)AMapTruckRouteSearch:(AMapTruckRouteSearchRequest *)request;
/**
* @brief 线 since 6.9.0
* @param request AMapTruckRouteSearchRequest
*/
- (void)AMapFutureRouteSearch:(AMapFutureRouteSearchRequest *)request;
/**
* @brief
* @param request AMapWeatherSearchRequest
*/
- (void)AMapWeatherSearch:(AMapWeatherSearchRequest *)request;
/**
* @brief since 5.1.0
* @param request AMapRoadTrafficSearchRequest
*/
- (void)AMapRoadTrafficSearch:(AMapRoadTrafficSearchRequest *)request;
/**
* @brief since 5.5.0
* @param request AMapRoadTrafficSearchRequest
*/
- (void)AMapRoadTrafficCircleSearch:(AMapRoadTrafficCircleSearchRequest *)request;
/**
* @brief since 6.1.0
* @param request AMapDistanceSearchRequest
*/
- (void)AMapDistanceSearch:(AMapDistanceSearchRequest *)request;
#pragma mark - 附近搜索相关
/**
* @brief
* @param request AMapNearbySearchRequest
*/
- (void)AMapNearbySearch:(AMapNearbySearchRequest *)request;
#pragma mark - 云图搜索相关
/**
* @brief
* @param request AMapCloudPOIAroundSearchRequest
*/
- (void)AMapCloudPOIAroundSearch:(AMapCloudPOIAroundSearchRequest *)request;
/**
* @brief polygon区域查询接口
* @param request AMapCloudPOIPolygonSearchRequest
*/
- (void)AMapCloudPOIPolygonSearch:(AMapCloudPOIPolygonSearchRequest *)request;
/**
* @brief ID查询接口
* @param request AMapCloudPOIIDSearchRequest
*/
- (void)AMapCloudPOIIDSearch:(AMapCloudPOIIDSearchRequest *)request;
/**
* @brief
* @param request AMapCloudPOILocalSearchRequest
*/
- (void)AMapCloudPOILocalSearch:(AMapCloudPOILocalSearchRequest *)request;
#pragma mark - 短串分享相关
/**
* @brief
* @param request AMapLocationShareSearchRequest
*/
- (void)AMapLocationShareSearch:(AMapLocationShareSearchRequest *)request;
/**
* @brief
* @param request AMapPOIShareSearchRequest
*/
- (void)AMapPOIShareSearch:(AMapPOIShareSearchRequest *)request;
/**
* @brief 线
* @param request AMapRouteShareSearchRequest
*/
- (void)AMapRouteShareSearch:(AMapRouteShareSearchRequest *)request;
/**
* @brief
* @param request AMapNavigationShareSearchRequest
*/
- (void)AMapNavigationShareSearch:(AMapNavigationShareSearchRequest *)request;
@end
#pragma mark - AMapSearchDelegate
///AMapSearchDelegate协议, 定义了搜索结果的回调方法,发生错误时的错误回调方法。
@protocol AMapSearchDelegate<NSObject>
@optional
/**
* @brief .
* @param request .
* @param error .
*/
- (void)AMapSearchRequest:(id)request didFailWithError:(NSError *)error;
/**
* @brief POI查询回调函数
* @param request AMapPOISearchBaseRequest
* @param response AMapPOISearchResponse
*/
- (void)onPOISearchDone:(AMapPOISearchBaseRequest *)request response:(AMapPOISearchResponse *)response;
/**
* @brief 沿 (since v4.3.0)
* @param request AMapRoutePOISearchRequest
* @param response AMapRoutePOISearchResponse
*/
- (void)onRoutePOISearchDone:(AMapRoutePOISearchRequest *)request response:(AMapRoutePOISearchResponse *)response;
/**
* @brief
* @param request AMapGeocodeSearchRequest
* @param response AMapGeocodeSearchResponse
*/
- (void)onGeocodeSearchDone:(AMapGeocodeSearchRequest *)request response:(AMapGeocodeSearchResponse *)response;
/**
* @brief
* @param request AMapReGeocodeSearchRequest
* @param response AMapReGeocodeSearchResponse
*/
- (void)onReGeocodeSearchDone:(AMapReGeocodeSearchRequest *)request response:(AMapReGeocodeSearchResponse *)response;
/**
* @brief
* @param request AMapInputTipsSearchRequest
* @param response AMapInputTipsSearchResponse
*/
- (void)onInputTipsSearchDone:(AMapInputTipsSearchRequest *)request response:(AMapInputTipsSearchResponse *)response;
/**
* @brief
* @param request AMapBusStopSearchRequest
* @param response AMapBusStopSearchResponse
*/
- (void)onBusStopSearchDone:(AMapBusStopSearchRequest *)request response:(AMapBusStopSearchResponse *)response;
/**
* @brief 线
* @param request AMapBusLineSearchRequest
* @param response AMapBusLineSearchResponse
*/
- (void)onBusLineSearchDone:(AMapBusLineBaseSearchRequest *)request response:(AMapBusLineSearchResponse *)response;
/**
* @brief
* @param request AMapDistrictSearchRequest
* @param response AMapDistrictSearchResponse
*/
- (void)onDistrictSearchDone:(AMapDistrictSearchRequest *)request response:(AMapDistrictSearchResponse *)response;
/**
* @brief
* @param request AMapRouteSearchBaseRequest
* @param response AMapRouteSearchResponse
*/
- (void)onRouteSearchDone:(AMapRouteSearchBaseRequest *)request response:(AMapRouteSearchResponse *)response;
/**
* @brief since 6.9.0
* @param request AMapRouteSearchBaseRequest
* @param response AMapRouteSearchResponse
*/
- (void)onFutureRouteSearchDone:(AMapRouteSearchBaseRequest *)request response:(AMapFutureRouteSearchResponse *)response;
/**
* @brief
* @param request AMapDistanceSearchRequest
* @param response AMapDistanceSearchResponse
*/
- (void)onDistanceSearchDone:(AMapDistanceSearchRequest *)request response:(AMapDistanceSearchResponse *)response;
/**
* @brief
* @param request AMapWeatherSearchRequest
* @param response AMapWeatherSearchResponse
*/
- (void)onWeatherSearchDone:(AMapWeatherSearchRequest *)request response:(AMapWeatherSearchResponse *)response;
/**
* @brief since 5.1.0
* @param request AMapRoadTrafficSearchBaseRequest
* @param response AMapRoadTrafficSearchResponse
*/
- (void)onRoadTrafficSearchDone:(AMapRoadTrafficSearchBaseRequest *)request response:(AMapRoadTrafficSearchResponse *)response;
#pragma mark - 附近搜索回调
/**
* @brief
* @param request AMapNearbySearchRequest
* @param response AMapNearbySearchResponse
*/
- (void)onNearbySearchDone:(AMapNearbySearchRequest *)request response:(AMapNearbySearchResponse *)response;
#pragma mark - 云图搜索回调
/**
* @brief
* @param request AMapCloudSearchBaseRequest
* @param response AMapCloudPOISearchResponse
*/
- (void)onCloudSearchDone:(AMapCloudSearchBaseRequest *)request response:(AMapCloudPOISearchResponse *)response;
#pragma mark - 短串分享搜索回调
/**
* @brief
* @param request
* @param response AMapShareSearchResponse
*/
- (void)onShareSearchDone:(AMapShareSearchBaseRequest *)request response:(AMapShareSearchResponse *)response;
@end