本文整理汇总了Java中com.baidu.mapapi.map.MapStatus类的典型用法代码示例。如果您正苦于以下问题:Java MapStatus类的具体用法?Java MapStatus怎么用?Java MapStatus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapStatus类属于com.baidu.mapapi.map包,在下文中一共展示了MapStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cancelBook
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
private void cancelBook() {
countDownTimer.cancel();
bike_layout.setVisibility(View.GONE);
bike_info_layout.setVisibility(View.GONE);
confirm_cancel_layout.setVisibility(View.GONE);
prompt.setVisibility(View.GONE);
bike_distance_layout.setVisibility(View.VISIBLE);
bike_distance_layout.setVisibility(View.VISIBLE);
book_bt.setVisibility(View.VISIBLE);
if (routeOverlay != null)
routeOverlay.removeFromMap();
MapStatus.Builder builder = new MapStatus.Builder();
//地图缩放比设置为18
builder.target(currentLL).zoom(18.0f);
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
示例2: zoomToSpan
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
@Override
public void zoomToSpan() {
if (mAmosfMap != null) {
try {
mAmosfMap.postDelayed(new Runnable() {
@Override
public void run() {
ConfirmCustomPoiOverlay.super.zoomToSpan();
if (mAmosfPoiBox.getVisibility() == View.VISIBLE) {
MapStatus ms = baiduMap.getMapStatus();
ms.targetScreen.set(ScreenUtil.getInstance().getWidthPixels() / 2, ScreenUtil.getInstance().getHeightPixels() / 4);
baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
}
}
}, 300);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例3: zoomToSpan
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
@Override
public void zoomToSpan() {
if (mAncpMap != null) {
try {
mAncpMap.postDelayed(new Runnable() {
@Override
public void run() {
ConfirmCustomPoiOverlay.super.zoomToSpan();
if (mAncpPoiBox.getVisibility() == View.VISIBLE) {
MapStatus ms = baiduMap.getMapStatus();
ms.targetScreen.set(ScreenUtil.getInstance().getWidthPixels() / 2, ScreenUtil.getInstance().getHeightPixels() / 4);
baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
}
}
}, 500);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例4: zoomToSpan
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
@Override
public void zoomToSpan() {
if (mapView != null) {
try {
mapView.postDelayed(new Runnable() {
@Override
public void run() {
ConfirmPoiOverlay.super.zoomToSpan();
if (mTrafficShowView.getPoiListBox().getVisibility() == View.VISIBLE) {
MapStatus ms = baiduMap.getMapStatus();
ms.targetScreen.set(ScreenUtil.getInstance().getWidthPixels() / 2, ScreenUtil.getInstance().getHeightPixels() / 4);
baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
}
}
}, 300);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例5: stopRunning
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
private void stopRunning() {
runningStatus = 2;
timer.stop();
client.stop();
startButton.setIdleText("跑步结束");
startButton.setProgress(0);
if (!pointList.isEmpty()) {
addMarker(pointList.get(pointList.size() - 1), R.drawable.ic_loc_end);
}
msUpdate = MapStatusUpdateFactory.newMapStatus(
new MapStatus.Builder().zoom(17).build()
);
baiduMap.setMapStatus(msUpdate);
locTimes = 0;//重置定位次数
stepSensor.unregisterStep();
saveRunData();
// 计算平均速度
float speed = Integer.parseInt(distanceNumber.getNumber()) / getSeconds();
speedNumber.setText(Utility.formatDecimal(speed, 2));
}
示例6: onMapStatusChange
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
@Override
public void onMapStatusChange(MapStatus mapStatus) {
int currentClusterSize = mMarkerManager.getCollectionSize();
// Log.d("----", "onMapStatusChange: 地图状态正在改变:"+currentClusterSize);
//地图的状态不停的改变,当聚合物集合的大小发生改变的时候,需要将recyclerView的显示给去掉
if(currentClusterSize != mLastClusterSize){
//取消recyclerView的显示,需要数据源和adapter的对象
mBaiduMap.hideInfoWindow();
}
if (mRenderer instanceof BaiduMap.OnMapStatusChangeListener) {
((BaiduMap.OnMapStatusChangeListener) mRenderer).onMapStatusChange(mapStatus);
}
// Don't re-compute clusters if the map has just been panned/tilted/rotated.
MapStatus position = mMap.getMapStatus();
if (mPreviousCameraPosition != null && mPreviousCameraPosition.zoom == position.zoom) {
return;
}
mPreviousCameraPosition = mMap.getMapStatus();
cluster();
}
示例7: onMapStatusChangeFinish
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
@Override
public void onMapStatusChangeFinish(MapStatus mapStatus) {
// int size = mMarkerManager.getCollectionSize();
mZoom = mBaiduMap.getMapStatus().zoom;
// if(mZoom <=12.4f){
// mBaiduMap.clear();
// isShow = false;
// }
if(mZoom <= 11f){
mBaiduMap.clear();
isShow = false;
}
if(mZoom >= 11f && mZoom <=16.0f){
if(!isShow){
isShow = true;
}
//允许显示定位图层
mBaiduMap.setMyLocationEnabled(true);
}
}
示例8: onReceiveLocation
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
@Override
public void onReceiveLocation(BDLocation location) {
// map view 销毁后不在处理新接收的位置
if (location == null || mMapView == null) {
return;
}
mCurrentLat = location.getLatitude();
mCurrentLon = location.getLongitude();
mCurrentAccracy = location.getRadius();
locData = new MyLocationData.Builder()
.accuracy(location.getRadius())
// 此处设置开发者获取到的方向信息,顺时针0-360
.direction(mCurrentDirection).latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
mBaiduMap.setMyLocationData(locData);
if (isFirstLoc) {
isFirstLoc = false;
LatLng ll = new LatLng(location.getLatitude(),
location.getLongitude());
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(ll).zoom(18.0f);
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
}
示例9: onCreate
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_routeplan);
mTvtitle = (TextView) findViewById(R.id.tv_topbar_title);
mTvtitle.setText("财神谷地址");
ImageView img = (ImageView) findViewById(R.id.img_topbar_back);
img.setImageResource(R.mipmap.icon_back);
img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RoutePlanDemo.this.finish();
}
});
// mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);//获取传感器管理服务
// 初始化地图
mMapView = (MapView) findViewById(R.id.map);
mBaidumap = mMapView.getMap();
MapStatus.Builder builder = new MapStatus.Builder();
builder.zoom(18.0f);
builder.target(new LatLng(29.184662, 121.305024));
mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(builder.build());
mBaidumap.setMapStatus(mMapStatusUpdate);
MarkerOptions ooA = new MarkerOptions().position(GEO_NINGBO).icon(bdA)
.zIndex(9).draggable(true);
mBaidumap.addOverlay(ooA);
mBaidumap.setTrafficEnabled(true);
findViewById(R.id.lin_action_route).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
go2ThirdMap();
}
});
}
示例10: onMapStatusChangeFinish
import com.baidu.mapapi.map.MapStatus; //导入依赖的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);
}
}
}
示例11: cancelBook
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
private void cancelBook() {
if (isNeedLogin) {
mLogin.setVisibility(View.VISIBLE);
} else {
mLogin.setVisibility(View.GONE);
}
mBikeInfoBoard.setVisibility(View.GONE);
countDownTimer.cancel();
mBikeOrderBoard.setVisibility(View.GONE);
// confirm_cancel_layout.setVisibility(View.GONE);
// prompt.setVisibility(View.GONE);
// bike_distance_layout.setVisibility(View.VISIBLE);
// bike_distance_layout.setVisibility(View.VISIBLE);
mBtLoginOrorder.setVisibility(View.VISIBLE);
if (routeOverlay != null)
routeOverlay.removeFromMap();
MapStatus.Builder builder = new MapStatus.Builder();
//地图缩放比设置为18
builder.target(currentLL).zoom(18.0f);
baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
示例12: drawRealtimePoint
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
/**
* 画出实时线路点
*
* @param point
*/
private void drawRealtimePoint(LatLng point) {
Log.i("TGA", "绘制成功");
mBaiduMap.clear();
MapStatus mapStatus = new MapStatus.Builder().target(point).zoom(18).build();
msUpdate = MapStatusUpdateFactory.newMapStatus(mapStatus);
realtimeBitmap = BitmapDescriptorFactory.fromResource(R.drawable.ct_map_location);
overlay = new MarkerOptions().position(point)
.icon(realtimeBitmap).zIndex(9).draggable(true);
if (pointList.size() >= 2 && pointList.size() <= 6000) {
polyline = new PolylineOptions().width(10).color(Color.GREEN).points(pointList);
}
addMarker();
}
示例13: onReceiveLocation
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
@Override
public void onReceiveLocation(BDLocation location) {
// map view 销毁后不在处理新接收的位置
if (location == null || mMapView == null) {
return;
}
MyLocationData locData = new MyLocationData.Builder()
.accuracy(location.getRadius())
// 此处设置开发者获取到的方向信息,顺时针0-360
.direction(100).latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
mBaiduMap.setMyLocationData(locData);
if (isFirstLoc) {
isFirstLoc = false;
LatLng ll = new LatLng(location.getLatitude(),
location.getLongitude());
applicate=(Myapplication)getApplication();
applicate.setLon(location.getLongitude());
applicate.setLat(location.getLatitude());
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(ll).zoom(18.0f);
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
}
示例14: initViews
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
private void initViews() {
mBtnPre = (Button) findViewById(R.id.btn_busline_pre);
mBtnNext = (Button) findViewById(R.id.btn_busline_next);
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
etRouteOnline = (EditText) findViewById(R.id.et_route_online);
mBaiduMap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.bmapView)).getBaiduMap();
// �趨��ͼ��ʼ���ĵ����꣨�����ʵ��ѧ����У����
LatLng xayd = new LatLng(34.162719, 108.907775);
// �趨��ͼ״̬���趨��ʼ���ĵ�����ż�����
MapStatus mMapStatus = new MapStatus.Builder().target(xayd).zoom(12)
.build();
// ����MapStatusUpdate�����Ա�������ͼ״̬��Ҫ�����ı仯
MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory
.newMapStatus(mMapStatus);
// ���õ�ͼ״̬
mBaiduMap.setMapStatus(mMapStatusUpdate);
}
示例15: setMapView
import com.baidu.mapapi.map.MapStatus; //导入依赖的package包/类
private void setMapView() {
BaiduMapOptions options = new BaiduMapOptions();
options.compassEnabled(false);
options.overlookingGesturesEnabled(false);
options.rotateGesturesEnabled(false);
options.scaleControlEnabled(true);
options.zoomControlsEnabled(false);
MapStatus.Builder status = new MapStatus.Builder();
if (Config.Zoom > Float.NEGATIVE_INFINITY)
status.zoom(Config.Zoom);
if (Config.Latitude > Double.NEGATIVE_INFINITY && Config.Longitude > Double.NEGATIVE_INFINITY)
status.target(new LatLng(Config.Latitude, Config.Longitude));
options.mapStatus(status.build());
mMapView = new MapView(this, options);
mMapView.getMap().setMyLocationEnabled(true);
mMapView.getMap().setBuildingsEnabled(false);
mMapView.getMap().setOnMapStatusChangeListener(this);
MapViewUtils.initViewPositions(mMapView);
MapViewUtils.addMapView(this, mMapView);
}