public class PoiSearchV2
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
PoiSearchV2.OnPoiSearchListener
本类为POI(Point Of Interest,兴趣点)搜索结果的异步处理回调接口。
|
static class |
PoiSearchV2.Query
此类定义了搜索的关键字,类别及城市。
|
static class |
PoiSearchV2.SearchBound
此类定义了查询圆形和查询矩形,查询返回的POI的位置在此圆形或矩形内。
|
static class |
PoiSearchV2.ShowFields
扩展字段
Extended field |
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
CHINESE
语言设置常量。
|
static java.lang.String |
ENGLISH
语言设置常量。
|
| 构造器和说明 |
|---|
PoiSearchV2(android.content.Context context,
PoiSearchV2.Query query)
根据给定的参数构造一个PoiSearch 的新对象。
|
| 限定符和类型 | 方法和说明 |
|---|---|
PoiSearchV2.SearchBound |
getBound()
返回查询矩形。
|
PoiSearchV2.Query |
getQuery()
返回查询条件。
|
PoiResultV2 |
searchPOI()
查询POI。
|
void |
searchPOIAsyn()
查询POI异步接口。
|
VisualSearchResult |
searchPOIByVisual(com.amap.api.services.poisearch.PoiSearchV2.VisualQuery visualQuery)
通过图片进行视觉识别搜索 POI(同步)。
|
void |
searchPOIByVisualAsyn(com.amap.api.services.poisearch.PoiSearchV2.VisualQuery visualQuery)
通过图片进行视觉识别搜索 POI(异步)。
|
PoiItemV2 |
searchPOIId(java.lang.String poiID)
已知poiid信息(点击地图底图),搜索POI的详细信息,同步
Search for detailed POI information based on a known POI ID (click on the base map), synchronous. |
void |
searchPOIIdAsyn(java.lang.String poiID)
已知poiid信息(点击地图底图),搜索POI的详细信息,异步
Search for detailed POI information based on a known POI ID (click on the base map), asynchronous. |
void |
setBound(PoiSearchV2.SearchBound bnd)
设置查询矩形。
|
void |
setOnPoiSearchListener(PoiSearchV2.OnPoiSearchListener listener)
设置查询监听接口。
|
void |
setQuery(PoiSearchV2.Query query)
设置查询条件。
|
public static final java.lang.String ENGLISH
public static final java.lang.String CHINESE
public PoiSearchV2(android.content.Context context,
PoiSearchV2.Query query)
throws AMapException
context - 对应的Context。
query - 查询条件。
AMapExceptionpublic void setOnPoiSearchListener(PoiSearchV2.OnPoiSearchListener listener)
listener - 查询监听接口。
public PoiResultV2 searchPOI() throws AMapException
如果此时矩形查询(SearchBound)已定义,则搜索范围为该矩形内的符合条件的POI,否则如果此时查询条件(Query)中的行政区划代码已定义,则搜索该城市(地区)内的所有符合条件的POI,如上述两个条件均未定义,则搜索范围为全国。为了性能及结果的清晰,强烈建议定义一个范围:矩形或行政区划代码均可。整个查询的语义为查找符合查询关键字, 符合查询类型编码组合及在指定范围内的所有POI。
此接口在网络连接出现问题的情况下,会抛出AMapException。
If a rectangular query (SearchBound) is defined at this time, the search scope will be the POIs that meet the conditions within that rectangle. Otherwise, if the administrative division code in the query condition (Query) is defined, all POIs that meet the conditions within that city (region) will be searched. If neither of the above two conditions is defined, the search scope will be nationwide. For performance and clarity of results, it is strongly recommended to define a scope: either a rectangle or an administrative division code. The semantics of the entire query is to find all POIs that match the query keywords, match the query type code combination, and are within the specified range.
This interface will throw an AMapException in case of network connection issues.
AMapException。AMapExceptionpublic void searchPOIAsyn()
public PoiItemV2 searchPOIId(java.lang.String poiID) throws AMapException
poiID - poi的ID
AMapExceptionpublic void searchPOIIdAsyn(java.lang.String poiID)
poiID - poi的ID
public VisualSearchResult searchPOIByVisual(com.amap.api.services.poisearch.PoiSearchV2.VisualQuery visualQuery)
throws AMapException
visualQuery - 视觉识别查询参数,包含图片地址和用户位置。AMapException - 网络异常或参数错误时抛出。public void searchPOIByVisualAsyn(com.amap.api.services.poisearch.PoiSearchV2.VisualQuery visualQuery)
PoiSearchV2.OnPoiSearchListener.onVisualSearched(VisualSearchResult, int) 回调返回。visualQuery - 视觉识别查询参数,包含图片地址和用户位置。public void setQuery(PoiSearchV2.Query query)
query - 新的查询条件。
public void setBound(PoiSearchV2.SearchBound bnd)
bnd - 新的查询矩形。
public PoiSearchV2.Query getQuery()
public PoiSearchV2.SearchBound getBound()