本文整理汇总了Java中com.baidu.mapapi.search.route.PlanNode类的典型用法代码示例。如果您正苦于以下问题:Java PlanNode类的具体用法?Java PlanNode怎么用?Java PlanNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlanNode类属于com.baidu.mapapi.search.route包,在下文中一共展示了PlanNode类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateBikeInfo
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
private void updateBikeInfo(BikeInfo bikeInfo) {
if (!hasPlanRoute) {
if (isNeedLogin) {
mBtLoginOrorder.setText("请登录后骑车");
} else {
mBtLoginOrorder.setText("预约骑车");
}
mLogin.setVisibility(View.GONE);
mTvLocationInfo.setVisibility(View.VISIBLE);
mBtLoginOrorder.setVisibility(View.VISIBLE);
mBikeInfoBoard.setVisibility(View.VISIBLE);
mLoBikeInfo.setVisibility(View.VISIBLE);
mMinute.setText(bikeInfo.getTime());
mTvDistance.setText(bikeInfo.getDistance());
bInfo = bikeInfo;
endNodeStr = PlanNode.withLocation(new LatLng(bikeInfo.getLatitude(), bikeInfo.getLongitude()));
drawPlanRoute(endNodeStr);
}
}
开发者ID:yiwent,项目名称:Mobike,代码行数:20,代码来源:MainActivity.java
示例2: onMapStatusChangeFinish
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
public void onMapStatusChangeFinish(MapStatus mapStatus) {
String _str = mapStatus.toString();
String _regex = "target lat: (.*)\ntarget lng";
String _regex2 = "target lng: (.*)\ntarget screen x";
changeLatitude = Double.parseDouble(latlng(_regex, _str));
changeLongitude = Double.parseDouble(latlng(_regex2, _str));
LatLng changeLL = new LatLng(changeLatitude, changeLongitude);
startNodeStr = PlanNode.withLocation(changeLL);
Log.d(TAG, "changeLatitude-----change--------" + changeLatitude);
Log.d(TAG, "changeLongitude-----change--------" + changeLongitude);
if (!isNeedCurrentlocation) {
MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(changeLL);
baiduMap.setMapStatus(u);
if (Math.hypot((changeLatitude - currentLatitude),
(changeLongitude - currentLongitude)) > 0.00001) {
Logger.d(Math.hypot((changeLatitude - currentLatitude),
(changeLongitude - currentLongitude)));
if (routeOverlay != null)
routeOverlay.removeFromMap();
addOverLayout(changeLatitude, changeLongitude);
}
}
}
开发者ID:yiwent,项目名称:Mobike,代码行数:25,代码来源:MainActivity.java
示例3: onCreate
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_geocode);
ButterKnife.bind(this);
Intent intent = getIntent();
mEndCity = intent.getStringExtra("mEndCity");
mEndAddr = intent.getStringExtra("mEndAddr");
loca = intent.getStringExtra("myLocation");
System.out.println(loca);
stNode = PlanNode.withCityNameAndPlaceName(mStartCity, loca);
enNode = PlanNode.withCityNameAndPlaceName(mEndCity, mEndAddr);
initModeView();
initMap();
}
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:18,代码来源:GeoCodeActivity.java
示例4: initView
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
private void initView() {
iv_back = (ImageView) findViewById(R.id.iv_back);
iv_back.setVisibility(View.VISIBLE);
iv_back.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
finish();
}
});
mMapView = (MapView) findViewById(R.id.bmapView);
mMapView.showScaleControl(false);
mMapView.showZoomControls(false);
mBaiduMap = mMapView.getMap();
mSearch = RoutePlanSearch.newInstance();
mSearch.setOnGetRoutePlanResultListener(this);
Intent intent = getIntent();
LatLng locLatLng = new LatLng(intent.getDoubleExtra("locLat", 0), intent.getDoubleExtra("locLon", 0));
LatLng desLatLng = new LatLng(intent.getDoubleExtra("lat", 0), intent.getDoubleExtra("lon", 0));
PlanNode st = PlanNode.withLocation(locLatLng);
PlanNode en = PlanNode.withLocation(desLatLng);
mSearch.drivingSearch(new DrivingRoutePlanOption().from(st).to(en));
}
开发者ID:CodeDogandCat,项目名称:CarApp,代码行数:26,代码来源:RouteActivity.java
示例5: searchRoute0
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
/**
* 搜索
*/
private void searchRoute0(PlanNode stNode, PlanNode enNode) throws Exception{
mBaiduMap.clear();
mRoutePlans.clear();
if (currentVehicle == R.id.routePlan_radioGroup_car) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode)
.to(enNode));
} else if (currentVehicle == R.id.routePlan_radioGroup_bus) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city(OneBusApplication.CURRENT_CITY)
.to(enNode));
} else if (currentVehicle == R.id.routePlan_radioGroup_foot) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
}
}
开发者ID:Mrsunsunshine,项目名称:FrontOne,代码行数:23,代码来源:RoutePlanActivity.java
示例6: onReceiveLocation
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
@Override
public void onReceiveLocation(BDLocation bdLocation) {
// map view 销毁后不在处理新接收的位置
if (bdLocation == null || mMapView == null) {
return;
}
MyLocationData locData = new MyLocationData.Builder()
.accuracy(bdLocation.getRadius())
.direction(mCurrentX)//设定图标方向 // 此处设置开发者获取到的方向信息,顺时针0-360
.latitude(bdLocation.getLatitude())
.longitude(bdLocation.getLongitude()).build();
mBaiduMap.setMyLocationData(locData);
currentLatitude = bdLocation.getLatitude();
currentLongitude = bdLocation.getLongitude();
current_addr.setText(bdLocation.getAddrStr());
currentLL = new LatLng(bdLocation.getLatitude(),
bdLocation.getLongitude());
LocationManager.getInstance().setCurrentLL(currentLL);
LocationManager.getInstance().setAddress(bdLocation.getAddrStr());
startNodeStr = PlanNode.withLocation(currentLL);
//option.setScanSpan(5000),每隔5000ms这个方法就会调用一次,而有些我们只想调用一次,所以要判断一下isFirstLoc
if (isFirstLoc) {
isFirstLoc = false;
LatLng ll = new LatLng(bdLocation.getLatitude(),
bdLocation.getLongitude());
MapStatus.Builder builder = new MapStatus.Builder();
//地图缩放比设置为18
builder.target(ll).zoom(18.0f);
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
changeLatitude = bdLocation.getLatitude();
changeLongitude = bdLocation.getLongitude();
if (!isServiceLive) {
addOverLayout(currentLatitude, currentLongitude);
}
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:MainActivity.java
示例7: onMapStatusChangeFinish
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
public void onMapStatusChangeFinish(MapStatus mapStatus) {
String _str = mapStatus.toString();
String _regex = "target lat: (.*)\ntarget lng";
String _regex2 = "target lng: (.*)\ntarget screen x";
changeLatitude = Double.parseDouble(latlng(_regex, _str));
changeLongitude = Double.parseDouble(latlng(_regex2, _str));
LatLng changeLL = new LatLng(changeLatitude, changeLongitude);
startNodeStr = PlanNode.withLocation(changeLL);
Log.d("gaolei", "changeLatitude-----change--------" + changeLatitude);
Log.d("gaolei", "changeLongitude-----change--------" + changeLongitude);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:MainActivity.java
示例8: updateBikeInfo
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
private void updateBikeInfo(BikeInfo bikeInfo) {
if (!hasPlanRoute) {
bike_layout.setVisibility(View.VISIBLE);
bike_time.setText(bikeInfo.getTime());
bike_distance.setText(bikeInfo.getDistance());
bInfo = bikeInfo;
endNodeStr = PlanNode.withLocation(new LatLng(bikeInfo.getLatitude(), bikeInfo.getLongitude()));
drawPlanRoute(endNodeStr);
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:MainActivity.java
示例9: drawPlanRoute
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
private void drawPlanRoute(PlanNode endNodeStr) {
if (routeOverlay != null)
routeOverlay.removeFromMap();
if (endNodeStr != null) {
Log.d("gaolei", "changeLatitude-----startNode--------" + startNodeStr.getLocation().latitude);
Log.d("gaolei", "changeLongitude-----startNode--------" + startNodeStr.getLocation().longitude);
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(startNodeStr).to(endNodeStr));
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:MainActivity.java
示例10: drawPlanRoute
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
private void drawPlanRoute(PlanNode endNodeStr) {
if (routeOverlay != null)
routeOverlay.removeFromMap();
if (endNodeStr != null) {
Log.d(TAG, "changeLatitude-----startNode--------" + startNodeStr.getLocation().latitude);
Log.d(TAG, "changeLongitude-----startNode--------" + startNodeStr.getLocation().longitude);
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(startNodeStr).to(endNodeStr));
}
}
开发者ID:yiwent,项目名称:Mobike,代码行数:11,代码来源:MainActivity.java
示例11: onReceiveLocation
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
@Override
public void onReceiveLocation(BDLocation bdLocation) {
if (bdLocation == null || baiduMap == null) {
return;
}
mBDLocation = bdLocation;
MyLocationData locData = new MyLocationData.Builder()
.accuracy(bdLocation.getRadius())
.direction(mCurrentX)//设定图标方向 // 此处设置开发者获取到的方向信息,顺时针0-360
.latitude(bdLocation.getLatitude())
.longitude(bdLocation.getLongitude()).build();
if (isNeedCurrentlocation)
baiduMap.setMyLocationData(locData);
currentLatitude = bdLocation.getLatitude();
currentLongitude = bdLocation.getLongitude();
mTvLocationInfo.setText(bdLocation.getAddrStr());
currentLL = new LatLng(bdLocation.getLatitude(),
bdLocation.getLongitude());
MyLocationManager.getInstance().setCurrentLL(currentLL);
MyLocationManager.getInstance().setAddress(bdLocation.getAddrStr());
startNodeStr = PlanNode.withLocation(currentLL);
//option.setScanSpan(5000),每隔5000ms这个方法就会调用一次,而有些我们只想调用一次,所以要判断一下isFirstLoc
if (isFirstLocation) {
isFirstLocation = false;
LatLng ll = new LatLng(bdLocation.getLatitude(),
bdLocation.getLongitude());
MapStatus.Builder builder = new MapStatus.Builder();
//地图缩放比设置为18
builder.target(ll).zoom(18.0f);
baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
changeLatitude = bdLocation.getLatitude();
changeLongitude = bdLocation.getLongitude();
if (!isServiceLive) {
addOverLayout(currentLatitude, currentLongitude);
}
}
}
开发者ID:yiwent,项目名称:Mobike,代码行数:38,代码来源:MainActivity.java
示例12: searchButtonProcess
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
/**
* 发起路线规划搜索示例
*
* @param v
*/
public void searchButtonProcess(View v) {
// 重置浏览节点的路线数据
route = null;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mBaidumap.clear();
// 处理搜索按钮响应
EditText editSt = (EditText) findViewById(R.id.start);
EditText editEn = (EditText) findViewById(R.id.end);
// 设置起终点信息,对于tranist search 来说,城市名无意义
PlanNode stNode = PlanNode.withCityNameAndPlaceName("北京", editSt.getText().toString());
PlanNode enNode = PlanNode.withCityNameAndPlaceName("北京", editEn.getText().toString());
// 实际使用中请对起点终点城市进行正确的设定
if (v.getId() == R.id.drive) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode).to(enNode));
} else if (v.getId() == R.id.transit) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode).city("北京").to(enNode));
} else if (v.getId() == R.id.walk) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode).to(enNode));
} else if (v.getId() == R.id.bike) {
mSearch.bikingSearch((new BikingRoutePlanOption())
.from(stNode).to(enNode));
}
}
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:34,代码来源:RoutePlanDemo.java
示例13: SearchButtonProcess
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
/**
* 发起路线规划搜索示例
*
* @param v
*/
public void SearchButtonProcess(View v) {
//重置浏览节点的路线数据
route = null;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mBaidumap.clear();
// 处理搜索按钮响应
EditText editSt = (EditText) findViewById(R.id.start);
EditText editEn = (EditText) findViewById(R.id.end);
//设置起终点信息,对于tranist search 来说,城市名无意义
PlanNode stNode = PlanNode.withCityNameAndPlaceName(city, editSt.getText().toString());
PlanNode enNode = PlanNode.withCityNameAndPlaceName(city, editEn.getText().toString());
// 实际使用中请对起点终点城市进行正确的设定
if (v.getId() == R.id.drive) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode)
.to(enNode));
} else if (v.getId() == R.id.transit) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city(city)
.to(enNode));
} else if (v.getId() == R.id.walk) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
}
}
开发者ID:BeckNiu,项目名称:MyCar,代码行数:35,代码来源:RoutePlanActivity.java
示例14: run
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
@Override
public void run() {
DialogUtil.dissMissLoading();
//设定中心点坐标
double lat0 = 0;
double lng0 = 0;
if (isFrom) {
//自定义出发地坐标
lat0 = Double.valueOf(map.get("lat0"));
lng0 = Double.valueOf(map.get("lng0"));
}
//目的地坐标
double lat = Double.valueOf(map.get("lat"));
double lng = Double.valueOf(map.get("lng"));
myLatLng = new LatLng(lat, lng);
MarkerOptions markerOptions = new MarkerOptions().position(myLatLng).icon(bd);
mBaiduMap.addOverlay(markerOptions);
mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
//改变地图状态
mBaiduMap.setMapStatus(mMapStatusUpdate);
LatLng stlatLng;
if (isFrom) {
stlatLng = new LatLng(lat0, lng0);
} else {
stlatLng = new LatLng(Const.LATITUDE_OF_MY_LOCATION, Const.LONGITUDE_OF_MY_LOCATION);
}
LatLng enlatLng = new LatLng(lat, lng);
PlanNode stNode = PlanNode.withLocation(stlatLng);
PlanNode enNode = PlanNode.withLocation(enlatLng);
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
}
开发者ID:CrazyRunning,项目名称:MyStudyHelper,代码行数:35,代码来源:MapActivity.java
示例15: SearchButtonProcess
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
public void SearchButtonProcess(View v) {
startCity = startCityText.getText().toString();
endCity = endCityText.getText().toString();
startPlace = startPlaceText.getText().toString();
endPlace = endPlaceText.getText().toString();
//设置起终点信息
stNode = PlanNode.withCityNameAndPlaceName(startCity, startPlace);
enNode = PlanNode.withCityNameAndPlaceName(endCity, endPlace);
TextView tv_rightTitle = (TextView) findViewById(R.id.tv_title_text);
if (v.getId() == R.id.drive) {
mSearch.drivingSearch((new DrivingRoutePlanOption())
.from(stNode)
.to(enNode));
tv_rightTitle.setText("开车去");
} else if (v.getId() == R.id.transit) {
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city(startCity)
.to(enNode));
tv_rightTitle.setText("坐公交");
} else if (v.getId() == R.id.walk) {
mSearch.walkingSearch((new WalkingRoutePlanOption())
.from(stNode)
.to(enNode));
tv_rightTitle.setText("走路去");
}
dialogBuilder.cancel();
}
开发者ID:PengZhiPeng,项目名称:Mooc-map,代码行数:29,代码来源:RoutePlan.java
示例16: searchRoute
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
/**
* 定位起点,输入终点
* @param startLocation
* @param endPosition
* @throws Exception
*/
private void searchRoute(LatLng startLocation, String endPosition) throws Exception{
Log.i(TAG+" searchRoute", "(Location, Position)");
PlanNode stNode = PlanNode.withLocation(startLocation);
PlanNode enNode = PlanNode.withCityNameAndPlaceName(OneBusApplication.CURRENT_CITY, endPosition);
searchRoute0(stNode,enNode);
}
开发者ID:Mrsunsunshine,项目名称:FrontOne,代码行数:13,代码来源:RoutePlanActivity.java
示例17: searchButtonProcess
import com.baidu.mapapi.search.route.PlanNode; //导入依赖的package包/类
/**
* ���˷�����ťѡ��
*
* @param v
*/
public void searchButtonProcess(View v) {
// ��������ڵ��·������
route = null;
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mBaidumap.clear();
// �������յ���Ϣ,���ó�����û�ã�Ĭ�ϱ���
// PlanNode stNode = PlanNode.withCityNameAndPlaceName("����", etStart
// .getText().toString());
// PlanNode enNode = PlanNode.withCityNameAndPlaceName("����", etEnd
// .getText().toString());
PlanNode stNode = PlanNode.withCityCodeAndPlaceName(233, etStart
.getText().toString().trim());
PlanNode enNode = PlanNode.withCityCodeAndPlaceName(233, etEnd
.getText().toString().trim());
// ͨ�������������յ���Ϣ
// PlanNode stNode = PlanNode.withLocation(stLatLng);
// PlanNode enNode = PlanNode.withLocation(enLatLng);
if (v.getId() == R.id.btn_search_timefirst) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_TIME_FIRST)
.from(stNode).city("����").to(enNode));
} else if (v.getId() == R.id.btn_search_transferfirst) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_TRANSFER_FIRST)
.from(stNode).city("����").to(enNode));
} else if (v.getId() == R.id.btn_search_walkfirst) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_WALK_FIRST)
.from(stNode).city("����").to(enNode));
} else if (v.getId() == R.id.btn_search_nosubway) {
mSearch.transitSearch((new TransitRoutePlanOption())
.policy(TransitRoutePlanOption.TransitPolicy.EBUS_NO_SUBWAY)
.from(stNode).city("����").to(enNode));
}
}
开发者ID:ContentCoderJian,项目名称:SmartTransXA,代码行数:46,代码来源:TransferOnlineActivity.java
注:本文中的com.baidu.mapapi.search.route.PlanNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论