本文整理汇总了Java中com.baidu.mapapi.search.busline.BusLineResult类的典型用法代码示例。如果您正苦于以下问题:Java BusLineResult类的具体用法?Java BusLineResult怎么用?Java BusLineResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BusLineResult类属于com.baidu.mapapi.search.busline包,在下文中一共展示了BusLineResult类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onGetBusLineResult
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
@Override
public void onGetBusLineResult(BusLineResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineOnlineActivity.this, "��Ǹ��δ�ҵ����",
Toast.LENGTH_LONG).show();
return;
}
mBaiduMap.clear();
route = result;
nodeIndex = -1;
overlay.removeFromMap();
overlay.setData(result);
overlay.addToMap();
overlay.zoomToSpan();
mBtnPre.setVisibility(View.VISIBLE);
mBtnNext.setVisibility(View.VISIBLE);
Toast.makeText(BusLineOnlineActivity.this, result.getBusLineName(),
Toast.LENGTH_SHORT).show();
}
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:20,代码来源:BusLineOnlineActivity.java
示例2: onGetBusLineResult
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
@Override
public void onGetBusLineResult(BusLineResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineSearchActivity.this, "抱歉,未找到结果",
Toast.LENGTH_LONG).show();
return;
}
mBaiduMap.clear();
route = result;
nodeIndex = -1;
overlay.removeFromMap();
overlay.setData(result);
overlay.addToMap();
overlay.zoomToSpan();
mBtnPre.setVisibility(View.VISIBLE);
mBtnNext.setVisibility(View.VISIBLE);
Toast.makeText(BusLineSearchActivity.this, result.getBusLineName(),
Toast.LENGTH_SHORT).show();
}
开发者ID:BeckNiu,项目名称:MyCar,代码行数:20,代码来源:BusLineSearchActivity.java
示例3: onGetBusLineResult
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
@Override
public void onGetBusLineResult(BusLineResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineSearch.this, "抱歉,未找到结果",
Toast.LENGTH_LONG).show();
return;
}
mBaiduMap.clear();
route = result;
nodeIndex = -1;
overlay.removeFromMap();
overlay.setData(result);
overlay.addToMap();
overlay.zoomToSpan();
mBtnPre.setVisibility(View.VISIBLE);
mBtnNext.setVisibility(View.VISIBLE);
Toast.makeText(BusLineSearch.this, result.getBusLineName(),
Toast.LENGTH_SHORT).show();
}
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:20,代码来源:BusLineSearch.java
示例4: onGetBusLineResult
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
@Override
public void onGetBusLineResult(BusLineResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusLineSearchDemo.this, "抱歉,未找到结果",
Toast.LENGTH_LONG).show();
bar.setVisibility(View.GONE); //线路没有显示出来了,关闭Progress
return;
} else if (result != null){
bar.setVisibility(View.GONE); //线路显示出来了,关闭Progress
}
mBaiduMap.clear();
route = result;
nodeIndex = -1;
BusLineOverlay overlay = new BusLineOverlay(mBaiduMap);
mBaiduMap.setOnMarkerClickListener(overlay);
overlay.setData(result);
overlay.addToMap();
overlay.zoomToSpan();
mBtnPre.setVisibility(View.VISIBLE);
mBtnNext.setVisibility(View.VISIBLE);
Toast.makeText(BusLineSearchDemo.this, result.getBusLineName(),
Toast.LENGTH_SHORT).show();
}
开发者ID:amazingokc,项目名称:BMap,代码行数:24,代码来源:BusLineSearchDemo.java
示例5: getOverlayOptions
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
@Override
public final List<OverlayOptions> getOverlayOptions() {
if (mBusLineResult == null || mBusLineResult.getStations() == null) {
return null;
}
List<OverlayOptions> overlayOptionses = new ArrayList<OverlayOptions>();
for (BusLineResult.BusStation station : mBusLineResult.getStations()) {
overlayOptionses.add(new MarkerOptions()
.position(station.getLocation())
.zIndex(10)
.anchor(0.5f, 0.5f)
.icon(BitmapDescriptorFactory
.fromAssetWithDpi("Icon_bus_station.png")));
}
List<LatLng> points = new ArrayList<LatLng>();
for (BusLineResult.BusStep step : mBusLineResult.getSteps()) {
if (step.getWayPoints() != null) {
points.addAll(step.getWayPoints());
}
}
if (points.size() > 0) {
overlayOptionses
.add(new PolylineOptions().width(10)
.color(Color.argb(178, 0, 78, 255)).zIndex(0)
.points(points));
}
return overlayOptionses;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:31,代码来源:BusLineOverlay.java
示例6: getOverlayOptions
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
@Override
public final List<OverlayOptions> getOverlayOptions() {
if (mBusLineResult == null || mBusLineResult.getStations() == null) {
return null;
}
List<OverlayOptions> overlayOptionses = new ArrayList<OverlayOptions>();
for (BusLineResult.BusStation station : mBusLineResult.getStations()) {
overlayOptionses.add(new MarkerOptions()
.position(station.getLocation())
.zIndex(10)
.anchor(0.5f, 0.5f)
.icon(BitmapDescriptorFactory
.fromAssetWithDpi("Icon_bus_station.png")));
}
List<LatLng> points = new ArrayList<LatLng>();
for (BusLineResult.BusStep step : mBusLineResult.getSteps()) {
if (step.getWayPoints() != null) {
points.addAll(step.getWayPoints());
}
}
if (points.size() > 0) {
overlayOptionses
.add(new PolylineOptions().width(10)
.color(Color.argb(178, 0, 78, 255)).zIndex(0)
.points(points));
}
return overlayOptionses;
}
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:31,代码来源:BusLineOverlay.java
示例7: onGetBusLineResult
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
/**
*
* 这是点击搜索按钮后,从服务器返回公交信息;在这里得到route值;
*/
@Override
public void onGetBusLineResult(BusLineResult result) {
if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
Toast.makeText(BusActivity.this, "抱歉,未找到结果", Toast.LENGTH_LONG)
.show();
return;
}
mBaiduMap.clear();
route = result;
nodeIndex = -1;
BusLineOverlay overlay = new BusLineOverlay(mBaiduMap);
mBaiduMap.setOnMarkerClickListener(overlay);
overlay.setData(result);
overlay.addToMap();
overlay.zoomToSpan();
mBtnPre.setVisibility(View.VISIBLE);
mBtnNext.setVisibility(View.VISIBLE);
Toast.makeText(context, result.getBusLineName(), Toast.LENGTH_SHORT)
.show();
Log.i("TAG", "总站数:" + result.getStations().size() + "");
// 在这里最好使用对话框的形式把公交信息显示出来;
String message = "";
Builder builder = new Builder(context);
builder.setTitle("为您查询到的地铁信息:");
for (int i = 0; i < result.getStations().size(); i++) {
message = message + "地铁" + (i + 1) + ":"
+ result.getStations().get(i).getTitle() + "\n";
}
builder.setMessage(city_return + result.getBusLineName() + "共有"
+ result.getStations().size() + "个地铁站:" + "\n" + message);
builder.setPositiveButton("确定", null);
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
开发者ID:chenyufeng1991,项目名称:BaiduMap-TrafficAssistant,代码行数:44,代码来源:BusActivity.java
示例8: setData
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
/**
* 设置公交线数据
*
* @param result
* 公交线路结果数据
*/
public void setData(BusLineResult result) {
this.mBusLineResult = result;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:BusLineOverlay.java
示例9: setData
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
/**
* 设置公交线数据
*
* @param result 公交线路结果数据
*/
public void setData(BusLineResult result) {
this.mBusLineResult = result;
}
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:9,代码来源:BusLineOverlay.java
示例10: setData
import com.baidu.mapapi.search.busline.BusLineResult; //导入依赖的package包/类
/**
* ���ù���������
*
* @param result
* ������·�������
*/
public void setData(BusLineResult result) {
this.mBusLineResult = result;
}
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:10,代码来源:BusLineOverlay.java
注:本文中的com.baidu.mapapi.search.busline.BusLineResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论