分类:C#、Android、VS2015、百度地图应用; 创建日期:2016-02-04一、简介POI(Point of Interest),中文可以翻译为“兴趣点”。在地理信息系统中,一个POI可以是一栋房子、一个商铺、一个邮筒、一个公交 ...
分类:C#、Android、VS2015、百度地图应用; 创建日期:2016-02-04
一、简介
POI(Point of Interest),中文可以翻译为“兴趣点”。在地理信息系统中,一个POI可以是一栋房子、一个商铺、一个邮筒、一个公交站等。
1、POI检索
百度地图SDK提供三种类型的POI检索:周边检索、区域检索和城市内检索。
l 周边检索:以某一点为中心,指定距离为半径,根据用户输入的关键词进行POI检索;
l 区域检索:在指定矩形区域内、根据关键词进行POI检索;
l 城市内检索:在某一城市内,根据用户输入的关键字进行POI检索;
自v3.6.1开始,城市poi检索返回结果新增门址类列表数据。例如:在“北京”搜索“上地十街1号”,除返回包含“上地十街1号”的poi列表以外,还包括地址为“上地十街1号”的明确门址。
具体来说,即PoiSearch类的SearchInCity(PoiCitySearchOption) 发起检索时返回的结果增加门址类数据。PoiResult中新增了GetAllAddr()获取门址类列表,当isHasAddrInfo() 返回true时,除了原poi列表外,还包含门址结果。
2、POI详情信息的检索
POI详情检索是指根据POI的ID信息,检索该兴趣点的详情。
3、在线建议查询
在线建议查询是指根据关键词查询在线建议词。为了帮助开发者实现检索出来的关键词快速定位到地图上,SDK自3.5.0版本起,开放了检索结果的经纬度信息及对应POI点的UID信息。
注意:
a. 在线建议检索的本质是根据部分关键是检索出来可能的完整关键词名称,如果需要这些关键词对应的POI的具体信息,请使用POI检索来完成;
b. 在线检索结果的第一条可能存在没有经纬度信息的情况,该条结果为文字联想出来的关键词结果,并不对应任何确切POI点。例如输入“肯”,第一条结果为“肯德基”,这条结果是一个泛指的名称,不会带有经纬度等信息。
二、运行截图
简介:介绍关键词查询、suggestion查询和查看餐饮类Place详情页功能
详述:
(1)点击某些关键词查询后的结果(如“餐厅”)可跳转到Place详情页;
(2)提供suggestion查询进行联想查询,例如输入“天安门”则会弹出联想查询的列表;
本示例运行截图如下:
三、设计步骤
1、添加demo12_poisearch.
在layout文件夹下添加该文件,然后将代码改为下面的内容:
<??><LinearLayout ="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout ="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="50dip" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="在" > </TextView> <EditText android:id="@+id/city" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="北京" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="市内找" > </TextView> <AutoCompleteTextView android:id="@+id/searchkey" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.88" android:text="餐厅" /> </LinearLayout> <LinearLayout ="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="50dip" android:orientation="horizontal" > <Button android:id="@+id/search" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="12" android:background="@drawable/button_style" android:padding="10dip" android:text="开始" /> <Button android:id="@+id/map_next_data" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="12" android:background="@drawable/button_style" android:padding="10dip" android:text="下一组数据" /> </LinearLayout> <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.baidu.mapapi.map.TextureMapFragment" /></LinearLayout>
原标题:第3章(第12讲)兴趣点( POI)搜索功能
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。