全部服务产品
开发者频道
定价
登录

文档全面上新

更科技的视觉体验,更高效的页面结构,快前往体验吧!

体验新版
 
(未显示1个用户的1个中间版本)
第1行: 第1行:
<div id="examples_center"><!-- 页面标题 --><div class="title-hd">地点检索</div><!-- 标题下子标题及简介,可有多个 --><div class="title-mi">功能场景</div><div class="wrap-mi">支持用户根据关键词查询出行的起终点、兴趣点等,可结合路线规划、导航等功能使用。</div><!--  --></div><div class="demos_wrap"><div class="header"><div class="andiord-header active">Android</div><div class="ios-header">iOS</div></div><div class="andiord-wrap wrap"><div class="wrap-wp"><div class="wrap_left"><div class="left-video"><div class="img-bg-and"></div><div class="phone-android"><div class="video-wrap infor"><div class="video-control"></div><!-- 安卓视频位置 (不写协议)--><pre>//mapopen-website-wiki.bj.bcebos.com/demos/AndroidVideos/地点检索@android.mp4</pre>
+
<div id="examples_center"><!-- 页面标题 --><div class="title-hd">地点检索</div><!-- 标题下子标题及简介,可有多个 --><div class="title-mi">功能场景</div><div class="wrap-mi">支持用户根据关键词查询出行的起终点、兴趣点等,可结合路线规划、导航等功能使用。</div><!--  --></div><div class="demos_wrap"><div class="header"><div class="andiord-header active">Android</div><div class="ios-header">iOS</div></div><div class="andiord-wrap wrap"><div class="wrap-wp"><div class="wrap_left"><div class="left-video"><div class="img-bg-and"></div><div class="phone-android"><div class="video-wrap infor"><div class="video-control"></div><!-- 安卓视频位置 (不写协议)--><pre>https://mapopen-website-wiki.bj.bcebos.com/demos/AndroidVideos/didianjiansuo_2.mp4</pre>
</div><div class="video-icon-and"><div class="play play-and"></div><div class="stop stop-and"></div></div></div><div class="progressWrap-hide-and"></div><div id="videoControls-and"><div id="progressWrap-and"><div id="playProgress-and"></div></div></div></div><div class="left-qrCode"><!-- 安卓二维码位置 --><div class="qrCode-and">1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/newqrcodes/地点检索@2xanidroid.png</div><div>扫码体验</div></div></div><div class="wrap_right"><div class="wrap_right_nav"><div class="wrap_right_nav_l"><div>使用产品</div><div><!-- IOS使用产品下选项,可有多个 --><!-- 产品1|/index.php?title=test --><div class="documentA">Android地图SDK|/index.php?title=androidsdk</div><!--  --><div>></div><div class="documentA">POI城市检索|/index.php?title=androidsdk/guide/search/poi</div></div><div><!-- IOS使用产品下选项,可有多个 --><!-- 产品1|/index.php?title=test --><div class="documentA">Android地图SDK|/index.php?title=androidsdk</div><!--  --><div>></div><div class="documentA">地点输入提示检索|/index.php?title=androidsdk/guide/search/poi</div></div></div><div class="wrap_right_nav_r">下载源码</div><!-- 安卓源码地址 --><div class="github-url-and">//mapopen-website-wiki.bj.bcebos.com/demos/BaiduMapSDKExample.zip</div></div><div class="wrap_table"><div class="table_nav"><div class="left-icon"></div><div>核心接口</div></div><div class="table_wrap"><div class="table_wrap_title"><div>类</div><div>接口</div><div>描述</div></div><!-- 表格接口,可有多个 --><div class="table_wrap_con"><div class="table_wrap_w"><div><div class="table-wrap-className">PoiSearch</div></div><div><div>searchInCity(PoiCitySearchOption option)</div></div><div><div>城市内检索</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiSearch</div></div><div><div>setOnGetPoiSearchResultListener(OnGetPoiSearchResultListener poiResultListener)</div></div><div><div>设置检索结果回调</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiCitySearchOption</div></div><div><div>city(String city)</div></div><div><div>设置检索城市</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiCitySearchOption</div></div><div><div>keyword(String key)</div></div><div><div>搜索关键字</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiCitySearchOption</div></div><div><div>cityLimit(boolean cityLimit)</div></div><div><div>设置区域数据召回限制 为true时,仅召回city对应区域内数据</div></div></div></div></div></div></div></div><div class="pre-nav"><div class="left-icon"></div><div>重点关注</div></div><div class="pre-nav"><div style="margin-left: 10px;">检索完成后需要调用PoiSearch的destroy()方法,否则会有内存泄露。</div></div><div class="pre-nav"><div class="left-icon"></div><div>核心代码</div></div><div class="pre-nav"><div>1.发起检索请求</div></div><div class="pre-wrap"><div class="pre-wrap-nav"><div>JAVA</div></div><!-- 安卓示例代码位置 --><div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint prettyprinted pre-and">// 发起请求
+
</div><div class="video-icon-and"><div class="play play-and"></div><div class="stop stop-and"></div></div></div><div class="progressWrap-hide-and"></div><div id="videoControls-and"><div id="progressWrap-and"><div id="playProgress-and"></div></div></div></div><div class="left-qrCode"><!-- 安卓二维码位置 --><div class="qrCode-and">1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/newqrcodes/地点检索@2xanidroid.png</div><div>扫码体验</div></div></div><div class="wrap_right"><div class="wrap_right_nav"><div class="wrap_right_nav_l"><div>使用产品</div><div><!-- IOS使用产品下选项,可有多个 --><div class="documentA">Android地图SDK|/index.php?title=androidsdk</div><!--  --><div>></div><div class="documentA">POI城市检索|/index.php?title=androidsdk/guide/search/poi</div></div><div><!-- IOS使用产品下选项,可有多个 --><div class="documentA">Android地图SDK|/index.php?title=androidsdk</div><!--  --><div>></div><div class="documentA">地点输入提示检索|/index.php?title=androidsdk/guide/search/poi</div></div></div><div class="wrap_right_nav_r">下载源码</div><!-- 安卓源码地址 --><div class="github-url-and">//mapopen-website-wiki.bj.bcebos.com/demos/BaiduMapSDKExample.zip</div></div><div class="wrap_table"><div class="table_nav"><div class="left-icon"></div><div>核心接口</div></div><div class="table_wrap"><div class="table_wrap_title"><div>类</div><div>接口</div><div>描述</div></div><!-- 表格接口,可有多个 --><div class="table_wrap_con"><div class="table_wrap_w"><div><div class="table-wrap-className">PoiSearch</div></div><div><div>searchInCity(PoiCitySearchOption option)</div></div><div><div>城市内检索</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiSearch</div></div><div><div>setOnGetPoiSearchResultListener(OnGetPoiSearchResultListener poiResultListener)</div></div><div><div>设置检索结果回调</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiCitySearchOption</div></div><div><div>city(String city)</div></div><div><div>设置检索城市</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiCitySearchOption</div></div><div><div>keyword(String key)</div></div><div><div>搜索关键字</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">PoiCitySearchOption</div></div><div><div>cityLimit(boolean cityLimit)</div></div><div><div>设置区域数据召回限制 为true时,仅召回city对应区域内数据</div></div></div></div></div></div></div></div><div class="pre-nav"><div class="left-icon"></div><div>重点关注</div></div><div class="pre-nav"><div style="margin-left: 10px;">检索完成后需要调用PoiSearch的destroy()方法,否则会有内存泄露。</div></div><div class="pre-nav"><div class="left-icon"></div><div>核心代码</div></div><div class="pre-nav"><div>1.发起检索请求</div></div><div class="pre-wrap"><div class="pre-wrap-nav"><div>JAVA</div></div><!-- 安卓示例代码位置 --><div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint prettyprinted pre-and">// 发起请求
 
mPoiSearch.searchInCity((new PoiCitySearchOption())
 
mPoiSearch.searchInCity((new PoiCitySearchOption())
 
         .city(cityStr)
 
         .city(cityStr)
第33行: 第33行:
 
                 </pre>
 
                 </pre>
 
<div class="pre-btn"><div class="pre-btn-copy-and">复制</div><div class="pre-btn-cb-and">深色</div></div><div class="success">复制成功</div></div></div></div><div class="ios-wrap wrap" style="display: none;"><div class="wrap-wp"><div class="wrap_left"><div class="left-video"><div class="img-bg-ios-sh"></div><div class="phone-ios"><div class="video-wrap infor"><div class="video-control"></div><!-- ios视频位置 --><pre>https://mapopen-website-wiki.bj.bcebos.com/demos/iosVideos/地点检索@3xios.mp4</pre>
 
<div class="pre-btn"><div class="pre-btn-copy-and">复制</div><div class="pre-btn-cb-and">深色</div></div><div class="success">复制成功</div></div></div></div><div class="ios-wrap wrap" style="display: none;"><div class="wrap-wp"><div class="wrap_left"><div class="left-video"><div class="img-bg-ios-sh"></div><div class="phone-ios"><div class="video-wrap infor"><div class="video-control"></div><!-- ios视频位置 --><pre>https://mapopen-website-wiki.bj.bcebos.com/demos/iosVideos/地点检索@3xios.mp4</pre>
</div><div class="video-icon-ios"><div class="play play-ios"></div><div class="stop stop-ios"></div></div></div><div class="progressWrap-hide-ios"></div><div id="videoControls-ios"><div id="progressWrap-ios"><div id="playProgress-ios"></div></div></div></div><div class="left-qrCode iosqrCode"><!-- ios二维码位置 --><div class="qrCode-ios">1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/ioscodes/地点检索@1xios.png</div><div>扫码体验</div></div></div><div class="wrap_right"><div class="wrap_right_nav"><div class="wrap_right_nav_l"><div>使用产品</div><div><!-- IOS使用产品下选项,可有多个 --><!-- 产品1|/index.php?title=test --><div class="documentA">iOS地图SDK|/index.php?title=iossdk</div><!--  --><div>></div><div class="documentA">POI城市检索|/index.php?title=iossdk/guide/search/poi</div></div><div><!-- IOS使用产品下选项,可有多个 --><!-- 产品1|/index.php?title=test --><div class="documentA">iOS地图SDK|/index.php?title=iossdk</div><!--  --><div>></div><div class="documentA">地点输入提示检索|/index.php?title=iossdk/guide/search/suggestion</div></div></div><div class="wrap_right_nav_r">下载源码</div><!-- IOS源码地址 --><div class="github-url-ios">//mapopen-website-wiki.bj.bcebos.com/BaiduMapSDKDemo.zip</div></div><div class="wrap_table"><div class="table_nav"><div class="left-icon"></div><div>核心接口</div></div><div class="table_wrap"><div class="table_wrap_title"><div>类</div><div>接口</div><div>描述</div></div><!-- ios表格接口内容,可有多个 --><!-- 表格接口,可有多个 --><div class="table_wrap_con"><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPOICitySearchOption</div></div><div><div>NSString *keyword</div></div><div><div>检索关键字(必选)</div></div></div><!--  --><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPOICitySearchOption</div></div><div><div>NSString *city</div></div><div><div>区域名称(必选)</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPOICitySearchOption</div></div><div><div>Bool isCityLimit</div></div><div><div>区域数据返回限制(可选)</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPoiSearch</div></div><div><div>- (BOOL)poiSearchInCity:(BMKPOICitySearchOption*)option;</div></div><div><div>发起城市POI检索</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPoiSearch</div></div><div><div>- (void)onGetPoiResult:(BMKPoiSearch*)searcher result:(BMKPOISearchResult*)poiResult errorCode:(BMKSearchErrorCode)errorCode;</div></div><div><div>返回POI搜索结果</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearchOption</div></div><div><div>NSString *keyword</div></div><div><div>搜索关键字,必选</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearchOption</div></div><div><div>NSString *cityname</div></div><div><div>城市名,参数也可以传入citycode,必选</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearchOption</div></div><div><div>BOOL cityLimit</div></div><div><div>是否只返回指定城市检索结果(默认:NO)(提示:海外区域暂不支持设置cityLimit)</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearch</div></div><div><div>- (BOOL)suggestionSearch:(BMKSuggestionSearchOption *)suggestionSearchOption;</div></div><div><div>发起Sug检索服务</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearch</div></div><div><div>- (void)onGetSuggestionResult:(BMKSuggestionSearch *)searcher result:(BMKSuggestionSearchResult *)result errorCode:(BMKSearchErrorCode)error;</div></div><div><div>返回Sug检索结果</div></div></div></div></div></div></div></div><div class="pre-nav"><div class="left-icon"></div><div>核心代码</div></div><div class="pre-nav"><div>1.发起Sug检索与POI检索</div></div><div class="pre-wrap"><div class="pre-wrap-nav"><div>Objective-C</div></div><div class="pre-wrap-w pre-wrap-w-ios code_container"><!-- ios示例代码位置 --><pre class="prettyprint prettyprinted pre-ios">// 根据输入发送sug检索
+
</div><div class="video-icon-ios"><div class="play play-ios"></div><div class="stop stop-ios"></div></div></div><div class="progressWrap-hide-ios"></div><div id="videoControls-ios"><div id="progressWrap-ios"><div id="playProgress-ios"></div></div></div></div><div class="left-qrCode iosqrCode"><!-- ios二维码位置 --><div class="qrCode-ios">1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/ioscodes/地点检索@1xios.png</div><div>扫码体验</div></div></div><div class="wrap_right"><div class="wrap_right_nav"><div class="wrap_right_nav_l"><div>使用产品</div><div><!-- IOS使用产品下选项,可有多个 --><div class="documentA">iOS地图SDK|/index.php?title=iossdk</div><!--  --><div>></div><div class="documentA">POI城市检索|/index.php?title=iossdk/guide/search/poi</div></div><div><!-- IOS使用产品下选项,可有多个 --><div class="documentA">iOS地图SDK|/index.php?title=iossdk</div><!--  --><div>></div><div class="documentA">地点输入提示检索|/index.php?title=iossdk/guide/search/suggestion</div></div></div><div class="wrap_right_nav_r">下载源码</div><!-- IOS源码地址 --><div class="github-url-ios">//mapopen-website-wiki.bj.bcebos.com/BaiduMapSDKDemo.zip</div></div><div class="wrap_table"><div class="table_nav"><div class="left-icon"></div><div>核心接口</div></div><div class="table_wrap"><div class="table_wrap_title"><div>类</div><div>接口</div><div>描述</div></div><!-- ios表格接口内容,可有多个 --><!-- 表格接口,可有多个 --><div class="table_wrap_con"><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPOICitySearchOption</div></div><div><div>NSString *keyword</div></div><div><div>检索关键字(必选)</div></div></div><!--  --><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPOICitySearchOption</div></div><div><div>NSString *city</div></div><div><div>区域名称(必选)</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPOICitySearchOption</div></div><div><div>Bool isCityLimit</div></div><div><div>区域数据返回限制(可选)</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPoiSearch</div></div><div><div>- (BOOL)poiSearchInCity:(BMKPOICitySearchOption*)option;</div></div><div><div>发起城市POI检索</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKPoiSearch</div></div><div><div>- (void)onGetPoiResult:(BMKPoiSearch*)searcher result:(BMKPOISearchResult*)poiResult errorCode:(BMKSearchErrorCode)errorCode;</div></div><div><div>返回POI搜索结果</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearchOption</div></div><div><div>NSString *keyword</div></div><div><div>搜索关键字,必选</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearchOption</div></div><div><div>NSString *cityname</div></div><div><div>城市名,参数也可以传入citycode,必选</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearchOption</div></div><div><div>BOOL cityLimit</div></div><div><div>是否只返回指定城市检索结果(默认:NO)(提示:海外区域暂不支持设置cityLimit)</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearch</div></div><div><div>- (BOOL)suggestionSearch:(BMKSuggestionSearchOption *)suggestionSearchOption;</div></div><div><div>发起Sug检索服务</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">BMKSuggestionSearch</div></div><div><div>- (void)onGetSuggestionResult:(BMKSuggestionSearch *)searcher result:(BMKSuggestionSearchResult *)result errorCode:(BMKSearchErrorCode)error;</div></div><div><div>返回Sug检索结果</div></div></div></div></div></div></div></div><div class="pre-nav"><div class="left-icon"></div><div>核心代码</div></div><div class="pre-nav"><div>1.发起Sug检索与POI检索</div></div><div class="pre-wrap"><div class="pre-wrap-nav"><div>Objective-C</div></div><div class="pre-wrap-w pre-wrap-w-ios code_container"><!-- ios示例代码位置 --><pre class="prettyprint prettyprinted pre-ios">// 根据输入发送sug检索
 
- (void)searchSugInfoWithKey:(NSString *)key {
 
- (void)searchSugInfoWithKey:(NSString *)key {
 
     if (key.length == 0) {
 
     if (key.length == 0) {
第136行: 第136行:
 
                          
 
                          
 
                 </pre>
 
                 </pre>
<div class="pre-btn"><div class="pre-btn-copy-ios">复制</div><div class="pre-btn-cb-ios">深色</div></div><div class="success">复制成功</div></div></div>
+
<div class="pre-btn"><div class="pre-btn-copy-ios">复制</div><div class="pre-btn-cb-ios">深色</div></div><div class="success">复制成功</div></div></div></div></div>
 
+
</div></div>
+

2023年8月16日 (三) 11:46的最后版本

地点检索
功能场景
支持用户根据关键词查询出行的起终点、兴趣点等,可结合路线规划、导航等功能使用。
Android
iOS
https://mapopen-website-wiki.bj.bcebos.com/demos/AndroidVideos/didianjiansuo_2.mp4
1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/newqrcodes/地点检索@2xanidroid.png
扫码体验
使用产品
Android地图SDK|/index.php?title=androidsdk
>
POI城市检索|/index.php?title=androidsdk/guide/search/poi
Android地图SDK|/index.php?title=androidsdk
>
地点输入提示检索|/index.php?title=androidsdk/guide/search/poi
下载源码
//mapopen-website-wiki.bj.bcebos.com/demos/BaiduMapSDKExample.zip
核心接口
接口
描述
PoiSearch
searchInCity(PoiCitySearchOption option)
城市内检索
PoiSearch
setOnGetPoiSearchResultListener(OnGetPoiSearchResultListener poiResultListener)
设置检索结果回调
PoiCitySearchOption
city(String city)
设置检索城市
PoiCitySearchOption
keyword(String key)
搜索关键字
PoiCitySearchOption
cityLimit(boolean cityLimit)
设置区域数据召回限制 为true时,仅召回city对应区域内数据
重点关注
检索完成后需要调用PoiSearch的destroy()方法,否则会有内存泄露。
核心代码
1.发起检索请求
JAVA
// 发起请求
mPoiSearch.searchInCity((new PoiCitySearchOption())
        .city(cityStr)
        .keyword(keyWordStr)
        .pageNum(mLoadIndex) // 分页编号
        .cityLimit(false)
        .scope(scope));
                
复制
深色
复制成功
2.检索结果回调处理
JAVA
@Override
public void onGetPoiResult(PoiResult poiResult) {
    if (poiResult == null || poiResult.error == SearchResult.ERRORNO.RESULT_NOT_FOUND) {
        Toast.makeText(PoiCitySearchActivity.this, "未找到结果", Toast.LENGTH_LONG).show();
        return;
    }

    List<PoiInfo> poiInfos = poiResult.getAllPoi();
    if (null == poiInfos) {
        return;
    }

    // 隐藏之前的
    hidePoiInfoLayout();

    mRecyclerView.setVisibility(View.VISIBLE);

    if (null == mPoiItemAdaper) {
        mPoiItemAdaper = new PoiItemAdapter(poiInfos);
    } else {
        mPoiItemAdaper.updateData(poiInfos);
    }
}
                
复制
深色
复制成功
  • 文档根本没法用

  • 文档水平很差

  • 文档水平一般

  • 文档不错

  • 文档写的很好

如发现文档错误,或对此文档有更好的建议,请在下方反馈。问题咨询请前往反馈平台提交工单咨询。

提交反馈

拖动标注工具

添加矩形标注

添加箭头标注

完成

取消