本文整理汇总了Java中com.baidu.mapapi.map.MapStatusUpdateFactory.newMapStatus方法的典型用法代码示例。如果您正苦于以下问题:Java MapStatusUpdateFactory.newMapStatus方法的具体用法?Java MapStatusUpdateFactory.newMapStatus怎么用?Java MapStatusUpdateFactory.newMapStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.baidu.mapapi.map.MapStatusUpdateFactory
的用法示例。
在下文中一共展示了MapStatusUpdateFactory.newMapStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stopRunning
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的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));
}
示例2: onCreate
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的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();
}
});
}
示例3: drawRealtimePoint
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的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();
}
示例4: initViews
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的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);
}
示例5: initBaiduMap
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initBaiduMap() {
mBaiduMap = mIMapView.getBaiduMap();
//获取地图对象控制器
mBaiduMap.setBuildingsEnabled(true);//设置显示楼体
mBaiduMap.setMapStatus(MapStatusUpdateFactory.zoomTo(19f));//设置地图状态
mUiSettings = mBaiduMap.getUiSettings();
mUiSettings.setZoomGesturesEnabled(true);
mUiSettings.setScrollGesturesEnabled(true);
mUiSettings.setRotateGesturesEnabled(true);
mUiSettings.setOverlookingGesturesEnabled(true);
mUiSettings.setCompassEnabled(true);
MapStatus ms = new MapStatus.Builder().overlook(30).build();
MapStatusUpdate u = MapStatusUpdateFactory.newMapStatus(ms);
mBaiduMap.animateMapStatus(u, 1000);
// 初始化搜索模块
mSearch = GeoCoder.newInstance();
mSearch.setOnGetGeoCodeResultListener(this);
}
示例6: initMapView
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* 初始化地图
*/
private void initMapView() {
//设定中心点坐标
myLatLng = new LatLng(Const.LATITUDE_OF_MY_LOCATION,Const.LONGITUDE_OF_MY_LOCATION);
//定义地图状态
MapStatus mMapStatus = new MapStatus.Builder()
.target(myLatLng)
.zoom(18)
.build();
//定义MapStatusUpdate对象,以便描述地图状态将要发生的变化
bd = BitmapDescriptorFactory
.fromResource(R.drawable.icon_gcoding);
MarkerOptions markerOptions = new MarkerOptions().position(myLatLng).icon(bd);
mBaiduMap.addOverlay(markerOptions);
MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
//改变地图状态
mBaiduMap.setMapStatus(mMapStatusUpdate);
}
示例7: initViews
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
@Override
protected void initViews() {
SDKInitializer.initialize(getApplicationContext());
setContentView(R.layout.activity_hospital_periphery_navigation);
setTitleBack("周边商户");
rbDrug = (RadioButton) findViewById(R.id.rb_drug);
rbHotel = (RadioButton) findViewById(R.id.rb_hotel);
rbBank = (RadioButton) findViewById(R.id.rb_bank);
rbIce = (RadioButton) findViewById(R.id.rb_ice);
mMapView = (MapView) findViewById(R.id.mv);
mBaiduMap = mMapView.getMap();
//普通地图
mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
//设定中心点坐标
LatLng centerPoint = new LatLng(31.3023280000, 120.5906890000);
//定义地图状态
MapStatus mMapStatus = new MapStatus.Builder()
.target(centerPoint)
.zoom(18)
.build();
//定义MapStatusUpdate对象,以便描述地图状态将要发生的变化
MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
//改变地图状态
mBaiduMap.setMapStatus(mMapStatusUpdate);
}
示例8: initViews
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initViews() {
mBtnPre = (Button) findViewById(R.id.pre);
mBtnNext = (Button) findViewById(R.id.next);
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
etStart = (EditText) findViewById(R.id.et_online_transstart);
etEnd = (EditText) findViewById(R.id.et_online_transend);
// ��ʼ����ͼ
mMapView = (MapView) findViewById(R.id.map);
mBaidumap = mMapView.getMap();
// �趨��ͼ��ʼ���ĵ����꣨�����ʵ��ѧ����У����
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);
// ��ʼ������ģ�飬ע���¼�����
mSearch = RoutePlanSearch.newInstance();
}
示例9: run
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的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));
}
示例10: updateCameraBearing
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
@Override
public void updateCameraBearing(float bearing) {
MapStatus ms = new MapStatus.Builder(getBaiduMap().getMapStatus()).rotate(bearing).build();
MapStatusUpdate u = MapStatusUpdateFactory.newMapStatus(ms);
getBaiduMap().animateMapStatus(u);
}
示例11: initMapCenterPoint
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* 初始化地图的中心点
*/
private void initMapCenterPoint() {
LatLng centerPoint = new LatLng(31.3023280000, 120.5906890000);//设定中心点坐标
MapStatus mMapStatus = new MapStatus.Builder()
.target(centerPoint)
.zoom(18)
.build();//定义地图状态
//定义MapStatusUpdate对象,以便描述地图状态将要发生的变化
MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
mBaiduMap.setMapStatus(mMapStatusUpdate);//改变地图状态
}
示例12: showCurrtenStroeOnMap
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* 根据传入的经纬度在地图上显示
*
* @param latitude
* @param longitude
*/
private void showCurrtenStroeOnMap(LatLng cenpt, float zoom) {
// 定义地图状态
MapStatus mMapStatus = new MapStatus.Builder().target(cenpt).zoom(zoom).build();
// 定义MapStatusUpdate对象,以便描述地图状态将要发生的变化
MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
allow = true;
// 改变地图状态
mBaiduMap.setMapStatus(mMapStatusUpdate);
}
示例13: initMapCenter
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
public static void initMapCenter(LatLng ll, BaiduMap baiduMap) {
if (ll != null) {
// 定义地图状态
MapStatus mMapStatus = new MapStatus.Builder().target(ll).zoom(18)
.build();
// 定义MapStatusUpdate对象,以便描述地图状态将要发生的变化
MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory
.newMapStatus(mMapStatus);
// 改变地图状态
baiduMap.setMapStatus(mMapStatusUpdate);
}
}
示例14: moveToLocation
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* 把地图移动到坐标位置
*/
private void moveToLocation(LatLng latLng) {
MapStatus mapStatus = new MapStatus.Builder().target(latLng).zoom(18).build();
msUpdate = MapStatusUpdateFactory.newMapStatus(mapStatus);
baiduMap.setMapStatus(msUpdate);
}
示例15: moveToLocation
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* 把地图移动到坐标位置
*/
private void moveToLocation(LatLng latLng) {
MapStatus mapStatus = new MapStatus.Builder().target(latLng).zoom(18).build();
MapStatusUpdate msUpdate = MapStatusUpdateFactory.newMapStatus(mapStatus);
baiduMap.setMapStatus(msUpdate);
}