本文整理匯總了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);
}