本文整理汇总了Java中com.baidu.mapapi.map.MapStatusUpdateFactory.zoomTo方法的典型用法代码示例。如果您正苦于以下问题:Java MapStatusUpdateFactory.zoomTo方法的具体用法?Java MapStatusUpdateFactory.zoomTo怎么用?Java MapStatusUpdateFactory.zoomTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.baidu.mapapi.map.MapStatusUpdateFactory
的用法示例。
在下文中一共展示了MapStatusUpdateFactory.zoomTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initView() {
mapView = (MapView) findViewById(R.id.see_location_mapview);
toolBarView = (ToolBarView) findViewById(R.id.see_location_toolbar);
toolBarView.setBackButtonImage(R.mipmap.icon_back);
toolBarView.setBackButtonVisible(true);
toolBarView.setBackButtonOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
toolBarView.setTitleText("查看接单人位置");
baiduMap = mapView.getMap();
MapStatusUpdate update = MapStatusUpdateFactory.zoomTo(19f);
baiduMap.setMapStatus(update);
handler = new MyHandler(this);
}
示例2: moveToMe
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void moveToMe(BDLocation location)
{
MapStatusUpdate mapUpdate=MapStatusUpdateFactory.zoomTo(18);
baiduMap.setMapStatus(mapUpdate);
//开始移动
MapStatusUpdate mapLatlng=MapStatusUpdateFactory.newLatLng(new LatLng(location.getLatitude(),location.getLongitude()));
baiduMap.setMapStatus(mapLatlng);
//显示我的位置
MyLocationData.Builder locationBuilder=new MyLocationData.Builder();
locationBuilder.latitude(location.getLatitude());
locationBuilder.longitude(location.getLongitude());
MyLocationData locationData=locationBuilder.build();
baiduMap.setMyLocationData(locationData);
//显示用户所在地附近
Toast.makeText(this,"您当前在"+location.getAddrStr()+"附近",Toast.LENGTH_SHORT).show();
}
示例3: initMapSetting
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initMapSetting() {
mMapView.showZoomControls(false);
mBaiduMap = mMapView.getMap();
// 开启定位图层
mBaiduMap.setMyLocationEnabled(true);
//设置指南针
// UiSettings uiSettings = mBaiduMap.getUiSettings();
// uiSettings.setCompassEnabled(true);
mBaiduMap.setCompassPosition(new Point(660,60));
//设置普通地图
mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
//设置定位图层配置信息,只有先允许定位图层后设置定位图层配置信息才会生效
mBaiduMap.setMyLocationConfiguration(new MyLocationConfiguration(
MyLocationConfiguration.LocationMode.NORMAL, false, null));
mBaiduMap.setBuildingsEnabled(false);
//设置缩放级别
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(16.0f);
mBaiduMap.setMapStatus(msu);
}
示例4: iniMap
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* iniMap 初始化地图
*/
private void iniMap() {
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true);// 打开gps
option.setCoorType("bd09ll"); // 设置坐标类型
option.setScanSpan(3000);
mCurrentMode = MyLocationConfiguration.LocationMode.NORMAL;
// 缩放
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(14.0f);
mBaiduMap.setMapStatus(msu);
mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(mCurrentMode, true, mCurrentMarker));
mLocClient.setLocOption(option);
mLocClient.start();
initOverlay();
// 开启线程,一直修改GPS坐标
LocationUtil.startLocaton();
}
示例5: navigateTo
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
public void navigateTo(BDLocation location){
if(isFirstLocate){
LatLng latLng=new LatLng(location.getLatitude(),location.getLongitude());
showToast("定位到当前位置已执行");
MapStatusUpdate update=MapStatusUpdateFactory.zoomTo(8f);
baiduMap.animateMapStatus(update);
update= MapStatusUpdateFactory.newLatLng(latLng);
baiduMap.animateMapStatus(update);
isFirstLocate=false;
}
MyLocationData.Builder locationBuilder=new MyLocationData.Builder();
locationBuilder.latitude(location.getLatitude());
locationBuilder.longitude(location.getLongitude());
baiduMap.setMyLocationData(locationBuilder.build());
}
示例6: onReceiveLocation
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
@Override
public void onReceiveLocation(BDLocation bdLocation) {
mLastLocationData=bdLocation;
MyLocationData myLocationData=new MyLocationData.Builder()
.accuracy(bdLocation.getRadius())
.latitude(bdLocation.getLatitude())
.longitude(bdLocation.getLongitude())
.build();
mBaiduMap.setMyLocationData(myLocationData);
MapStatusUpdate msu1 = MapStatusUpdateFactory.zoomTo(15.0f);
mBaiduMap.setMapStatus(msu1);
if(isFirstIn){
LatLng ll=new LatLng(bdLocation.getLatitude(),bdLocation.getLongitude());
MapStatusUpdate msu=MapStatusUpdateFactory.newLatLng(ll);
mBaiduMap.setMapStatus(msu);
isFirstIn=false;
}
}
示例7: navigateTo
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* des:地图跳到指定位置
*
* @param location
*/
private void navigateTo(BDLocation location) {
if (isFirstLocation) {
LatLng ll = new LatLng(location.getLatitude(), location.getLongitude());
MapStatusUpdate update = MapStatusUpdateFactory.newLatLng(ll);
baiduMap.animateMapStatus(update);
update = MapStatusUpdateFactory.zoomTo(18f);
baiduMap.animateMapStatus(update);
isFirstLocation = false;
}
MyLocationData.Builder builder = new MyLocationData.Builder();
builder.latitude(location.getLatitude());
builder.longitude(location.getLongitude());
MyLocationData data = builder.build();
baiduMap.setMyLocationData(data);
}
示例8: addMarker
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
/**
* 添加覆盖物
*/
protected void addMarker() {
if(null != mapStatusUpdate){
MapStatusUpdate ms = MapStatusUpdateFactory.zoomTo(19);
mBaiduMap.setMapStatus(mapStatusUpdate);
mBaiduMap.animateMapStatus(ms);
Log.i(MainActivity.TAG, "zoom level = "+ mBaiduMap.getMaxZoomLevel());
}
if(null != startMarker){
mBaiduMap.addOverlay(startMarker);
}
if(null != endMarker){
mBaiduMap.addOverlay(endMarker);
}
if(null != polylineOptions){
mBaiduMap.addOverlay(polylineOptions);
}
}
示例9: initView
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initView() {
mMapView = (MapView) findViewById(R.id.id_bmapView);
mBaiduMap = mMapView.getMap();
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(17.0f);//缩放等级17=100m
mBaiduMap.setMapStatus(msu);
mLocationMode = MyLocationConfiguration.LocationMode.NORMAL;
//隐藏缩放控件和百度logo
int childCount = mMapView.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = mMapView.getChildAt(i);
if (child instanceof ZoomControls || child instanceof ImageView) {
child.setVisibility(View.GONE);
}
}
//改变比例尺的位置
final int screenheight = this.getWindowManager().getDefaultDisplay().getHeight();
mBaiduMap.setOnMapLoadedCallback(new BaiduMap.OnMapLoadedCallback() {
@Override
public void onMapLoaded() {
mMapView.setScaleControlPosition(new Point(200, screenheight - 307));
}
});
}
示例10: initView
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initView() {
mBtnPre = (Button) findViewById(R.id.pre);
mBtnNext = (Button) findViewById(R.id.next);
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
busSearchView = findViewById(R.id.bus_searchView);
mBaiduMap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.bmapView)).getBaiduMap();
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(16.0f);//缩放等级16=200m
mBaiduMap.setMapStatus(msu);
mlocationClient = new LocationClient(this);
mLocationListener = new MyLocationListener();
mlocationClient.registerLocationListener(mLocationListener);
LocationClientOption option = new LocationClientOption();
option.setCoorType("bd09ll");
option.setIsNeedAddress(true);
option.setOpenGps(true);
option.setScanSpan(1000);
mlocationClient.setLocOption(option);
}
示例11: onCreate
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
setImmerseLayout(findViewById(R.id.map_layout));
instance = this;
init();
mLocationClient = new LocationClient(getApplicationContext()); // 声明LocationClient类
initLocation();
mLocationClient.start();
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(maxZoom);
mBaiduMap.setMapStatus(msu);
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setOnMapClickListener(this);
mBaiduMap.setOnMapStatusChangeListener(this);
initMarkerClickEvent();
}
示例12: initView
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initView() {
// 获取地图控件引用
mMapView = (MapView) findViewById(R.id.bmapView);
mbaiduMap = mMapView.getMap();
// 设置地图放大缩小参数
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(15.0f);
mbaiduMap.setMapStatus(msu);
}
示例13: initView
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void initView() {
// 获取地图控件引用
mMapView = (MapView) findViewById(R.id.bmapView);
mbaiduMap = mMapView.getMap();
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(15.0f);
mbaiduMap.setMapStatus(msu);
list = new ArrayList<Marker>();
}
示例14: navigateTo
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
private void navigateTo(BDLocation location){
if (isFirstLocate){
LatLng ll = new LatLng(location.getLatitude(),location.getLongitude());
MapStatusUpdate update = MapStatusUpdateFactory.newLatLng(ll);
baiduMap.animateMapStatus(update);
update = MapStatusUpdateFactory.zoomTo(16f);
baiduMap.animateMapStatus(update);
isFirstLocate = false;
}
MyLocationData.Builder locationBuilder = new MyLocationData.Builder();
locationBuilder.latitude(location.getLatitude());
locationBuilder.longitude(location.getLongitude());
MyLocationData locationData = locationBuilder.build();
baiduMap.setMyLocationData(locationData);
}
示例15: zoomToMaxLevel
import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入方法依赖的package包/类
public static void zoomToMaxLevel(MapView mapView, boolean animated) {
float zoom = mapView.getMap().getMaxZoomLevel();
MapStatusUpdate update = MapStatusUpdateFactory.zoomTo(zoom);
if (animated)
mapView.getMap().animateMapStatus(update);
else
mapView.getMap().setMapStatus(update);
}