PoiSearchV2
PoiSearchV2public class PoiSearch
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
PoiSearch.OnPoiSearchListener
已过时。
本类为POI(Point Of Interest,兴趣点)搜索结果的异步处理回调接口。
|
static class |
PoiSearch.Query
已过时。
此类定义了搜索的关键字,类别及城市。
|
static class |
PoiSearch.SearchBound
已过时。
此类定义了查询圆形和查询矩形,查询返回的POI的位置在此圆形或矩形内。
|
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
CHINESE
已过时。
语言设置常量。
|
static java.lang.String |
ENGLISH
已过时。
语言设置常量。
|
static java.lang.String |
EXTENSIONS_ALL
已过时。
扩展字段all,会返回完整参数
The extension field 'all' will return complete parameters. |
static java.lang.String |
EXTENSIONS_BASE
已过时。
扩展字段base,会返回部分参数
The extension field 'base' will return partial parameters. |
| 构造器和说明 |
|---|
PoiSearch(android.content.Context context,
PoiSearch.Query query)
已过时。
根据给定的参数构造一个PoiSearch 的新对象。
|
| 限定符和类型 | 方法和说明 |
|---|---|
PoiSearch.SearchBound |
getBound()
已过时。
返回查询矩形。
|
java.lang.String |
getLanguage()
已过时。
自V2.5.0后废弃,请参考
ServiceSettings.getLanguage()
Deprecated since V2.5.0, please refer to ServiceSettings.getLanguage() |
PoiSearch.Query |
getQuery()
已过时。
返回查询条件。
|
PoiResult |
searchPOI()
已过时。
查询POI。
|
void |
searchPOIAsyn()
已过时。
查询POI异步接口。
|
PoiItem |
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(PoiSearch.SearchBound bnd)
已过时。
设置查询矩形。
|
void |
setLanguage(java.lang.String language)
已过时。
自V2.5.0后废弃,请参考
ServiceSettings.setLanguage(String)
Deprecated since V2.5.0, please refer to ServiceSettings.setLanguage(String) |
void |
setOnPoiSearchListener(PoiSearch.OnPoiSearchListener listener)
已过时。
设置查询监听接口。
|
void |
setQuery(PoiSearch.Query query)
已过时。
设置查询条件。
|
public static final java.lang.String ENGLISH
public static final java.lang.String CHINESE
public static final java.lang.String EXTENSIONS_ALL
public static final java.lang.String EXTENSIONS_BASE
public PoiSearch(android.content.Context context,
PoiSearch.Query query)
throws AMapException
context - 对应的Context。
query - 查询条件。
AMapExceptionpublic void setOnPoiSearchListener(PoiSearch.OnPoiSearchListener listener)
listener - 查询监听接口。
public void setLanguage(java.lang.String language)
ServiceSettings.setLanguage(String)
ServiceSettings.setLanguage(String)language - 支持ENGLISH和CHINESE。
public java.lang.String getLanguage()
ServiceSettings.getLanguage()
ServiceSettings.getLanguage()public PoiResult 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 PoiItem searchPOIId(java.lang.String poiID) throws AMapException
poiID - poi的ID
AMapExceptionpublic void searchPOIIdAsyn(java.lang.String poiID)
poiID - poi的ID
public void setQuery(PoiSearch.Query query)
query - 新的查询条件。
public void setBound(PoiSearch.SearchBound bnd)
bnd - 新的查询矩形。
public PoiSearch.Query getQuery()
public PoiSearch.SearchBound getBound()