本文整理汇总了Java中com.baidu.mapapi.map.MapView.showZoomControls方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.showZoomControls方法的具体用法?Java MapView.showZoomControls怎么用?Java MapView.showZoomControls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.baidu.mapapi.map.MapView
的用法示例。
在下文中一共展示了MapView.showZoomControls方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import com.baidu.mapapi.map.MapView; //导入方法依赖的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));
}
示例2: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SDKInitializer.initialize(getApplicationContext());
setContentView(R.layout.activity_run_details);
disText = (TextView) findViewById(R.id.dis_text_details);
stepNumber = (NumberView) findViewById(R.id.step_text_details);
speedNumber = (NumberView) findViewById(R.id.speed_text_details);
dateNumber = (NumberView) findViewById(R.id.date_text_details);
stepNumber = (NumberView) findViewById(R.id.step_text_details);
durationNumber = (NumberView) findViewById(R.id.duration_details);
energyNumber = (NumberView) findViewById(R.id.energy_details);
startTimeNumber = (NumberView) findViewById(R.id.start_time_text_details);
mapView = (MapView) findViewById(R.id.map_view_details);
noTrailText = (TextView) findViewById(R.id.no_trail_text);
floatInfo = (LinearLayout) findViewById(R.id.run_detail_float_info);
mapView.showZoomControls(false);
baiduMap = mapView.getMap();
setToolbar(R.id.details_toolbar, true);
Intent intent = getIntent();
Bundle bundle = intent.getExtras();
if (bundle != null) {
//是否为好友的跑步信息
isFriend = bundle.getBoolean("is_friend", false);
//获得序列化runningInfo
mRunningInfo = (RunningInfo) intent.getSerializableExtra("running_info");
setAllData(mRunningInfo);
} else {
Toast.makeText(this, "发生异常。", Toast.LENGTH_SHORT).show();
finish();
}
}
示例3: IniView
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
@Override
protected void IniView() {
bt_Ok = (Button) findViewById(R.id.bt_Ok);
tv_location = (TextView) findViewById(R.id.tv_location);
mDrawerLayout = (DrawerLayout) findViewById(R.id.dl_left);
mTopbanner = (TopBanner) findViewById(R.id.topbanner);
mAboutAuthor = (TextView) findViewById(R.id.tv_about_me);
mCurrentLocation = (ImageView)findViewById(R.id.iv_location);
mStopMock = (ImageView)findViewById(R.id.iv_stop_location);
mPreciseLocation = (TextView)findViewById(R.id.tv_precise);
mAddProcess = (TextView) findViewById(R.id.tv_add_app);
//加载旋转动画
mOperatingAnim = AnimationUtils.loadAnimation(this, R.anim.spinloaing);
LinearInterpolator lin = new LinearInterpolator();
mOperatingAnim.setInterpolator(lin);
// 地图初始化
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiduMap = mMapView.getMap();
// 开启定位图层
mBaiduMap.setMyLocationEnabled(true);
//隐藏地图比例尺
mMapView.showScaleControl(false);
//关闭缩放放大控件
mMapView.showZoomControls(false);
mMapView.removeViewAt(1);
// 定位初始化
mLocClient = new LocationClient(this);
}
示例4: initView
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
/**
* *****************************************************************************
*/
private void initView() {
iv_list = (ImageView) findViewById(R.id.iv_list);
iv_list.setOnClickListener(this);
iv_loc = (ImageView) findViewById(R.id.iv_loc);
iv_loc.setOnClickListener(this);
tv_title_right = (TextView) findViewById(R.id.tv_title_button);
tv_title_right.setText(getResources().getString(R.string.kilometre_3) + " >");
tv_title_right.setVisibility(View.VISIBLE);
tv_title_right.setOnClickListener(this);
ll_summary = (LinearLayout) findViewById(R.id.ll_summary);
ll_summary.setOnClickListener(this);
tv_name = (TextView) findViewById(R.id.tv_name);
tv_distance = (TextView) findViewById(R.id.tv_distance);
tv_price_a = (TextView) findViewById(R.id.tv_price_a);
tv_price_b = (TextView) findViewById(R.id.tv_price_b);
mMapView = (MapView) findViewById(R.id.bmapView);
mMapView.showScaleControl(false);
mMapView.showZoomControls(false);
mBaiduMap = mMapView.getMap();
mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(MyLocationConfiguration.LocationMode.FOLLOWING, true, null));
mBaiduMap.setMyLocationEnabled(true);
mLocationClient = new LocationClient(mContext);
mLocationClient.registerLocationListener(mListener);
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationMode.Battery_Saving);// 模拟器测试用高精度;
// 手机真机测试用Battery_Saving:低精度.
option.setCoorType(Config.Baidu_LatLon); // 返回国测局经纬度坐标系:gcj02 返回百度墨卡托坐标系 :bd09
// 返回百度经纬度坐标系 :bd09ll
option.setScanSpan(0);// 设置扫描间隔,单位毫秒,当<1000(1s)时,定时定位无效
option.setIsNeedAddress(true);// 设置是否需要地址信息,默认为无地址
option.setNeedDeviceDirect(true);// 在网络定位时,是否需要设备方向
mLocationClient.setLocOption(option);
}
示例5: initView
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
private void initView() {
iv_list = (ImageView) findViewById(R.id.iv_list);
iv_list.setOnClickListener(this);
iv_loc = (ImageView) findViewById(R.id.iv_loc);
iv_loc.setOnClickListener(this);
tv_title_right = (TextView) findViewById(R.id.tv_title_button);
tv_title_right.setText("3km" + " >");
tv_title_right.setVisibility(View.VISIBLE);
tv_title_right.setOnClickListener(this);
ll_summary = (LinearLayout) findViewById(R.id.ll_summary);
ll_summary.setOnClickListener(this);
tv_name = (TextView) findViewById(R.id.tv_name);
tv_distance = (TextView) findViewById(R.id.tv_distance);
tv_price_a = (TextView) findViewById(R.id.tv_price_a);
tv_price_b = (TextView) findViewById(R.id.tv_price_b);
mMapView = (MapView) findViewById(R.id.bmapView);
mMapView.showScaleControl(false);
mMapView.showZoomControls(false);
mBaiduMap = mMapView.getMap();
mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(
MyLocationConfiguration.LocationMode.FOLLOWING, true, null));
mBaiduMap.setMyLocationEnabled(true);
mLocationClient = new LocationClient(mContext);
mLocationClient.registerLocationListener(mListener);
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationMode.Hight_Accuracy);// 高精度;
// Battery_Saving:低精度.
option.setCoorType("bd09ll"); // 返回国测局经纬度坐标系:gcj02 返回百度墨卡托坐标系 :bd09
// 返回百度经纬度坐标系 :bd09ll
option.setScanSpan(0);// 设置扫描间隔,单位毫秒,当<1000(1s)时,定时定位无效
option.setIsNeedAddress(true);// 设置是否需要地址信息,默认为无地址
option.setNeedDeviceDirect(true);// 在网络定位时,是否需要设备方向
mLocationClient.setLocOption(option);
}
示例6: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_route_detail);
setStatusBar();
route_detail_mapview = (MapView) findViewById(R.id.route_detail_mapview);
total_time = (TextView) findViewById(R.id.total_time);
total_distance = (TextView) findViewById(R.id.total_distance);
total_price = (TextView) findViewById(R.id.total_pricce);
routeBaiduMap = route_detail_mapview.getMap();
route_detail_mapview.showZoomControls(false);
startBmp = BitmapDescriptorFactory.fromResource(R.mipmap.route_start);
endBmp = BitmapDescriptorFactory.fromResource(R.mipmap.route_end);
initMap();
Intent intent = getIntent();
String time = intent.getStringExtra("totalTime");
String distance = intent.getStringExtra("totalDistance");
String price = intent.getStringExtra("totalPrice");
routePointsStr = intent.getStringExtra("routePoints");
routePoints = new Gson().fromJson(routePointsStr, new TypeToken<List<RoutePoint>>() {
}.getType());
List<LatLng> points = new ArrayList<LatLng>();
for (int i = 0; i < routePoints.size(); i++) {
RoutePoint point = routePoints.get(i);
LatLng latLng = new LatLng(point.getRouteLat(), point.getRouteLng());
Log.d("gaolei", "point.getRouteLat()----show-----" + point.getRouteLat());
Log.d("gaolei", "point.getRouteLng()----show-----" + point.getRouteLng());
points.add(latLng);
}
if (points.size() > 2) {
OverlayOptions ooPolyline = new PolylineOptions().width(10)
.color(0xFF36D19D).points(points);
routeBaiduMap.addOverlay(ooPolyline);
RoutePoint startPoint = routePoints.get(0);
LatLng startPosition = new LatLng(startPoint.getRouteLat(), startPoint.getRouteLng());
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(startPosition).zoom(18.0f);
routeBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
RoutePoint endPoint = routePoints.get(routePoints.size() - 1);
LatLng endPosition = new LatLng(endPoint.getRouteLat(), endPoint.getRouteLng());
addOverLayout(startPosition, endPosition);
}
total_time.setText("骑行时长:" + time + "分钟");
total_distance.setText("骑行距离:" + distance + "米");
total_price.setText("余额支付:" + price + "元");
}
示例7: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_route_detail);
route_detail_mapview = (MapView) findViewById(R.id.route_detail_mapview);
total_time = (TextView) findViewById(R.id.total_time);
total_distance = (TextView) findViewById(R.id.total_distance);
total_price = (TextView) findViewById(R.id.total_pricce);
routeBaiduMap = route_detail_mapview.getMap();
route_detail_mapview.showZoomControls(false);
startBmp = BitmapDescriptorFactory.fromResource(R.mipmap.route_start);
endBmp = BitmapDescriptorFactory.fromResource(R.mipmap.route_end);
initMap();
Intent intent = getIntent();
String time = intent.getStringExtra("totalTime");
String distance = intent.getStringExtra("totalDistance");
String price = intent.getStringExtra("totalPrice");
routePointsStr = intent.getStringExtra("routePoints");
routePoints = new Gson().fromJson(routePointsStr, new TypeToken<List<RoutePoint>>() {
}.getType());
savaDatas(time,distance,price);//yiwen add
List<LatLng> points = new ArrayList<LatLng>();
for (int i = 0; i < routePoints.size(); i++) {
RoutePoint point = routePoints.get(i);
LatLng latLng = new LatLng(point.getRouteLat(), point.getRouteLng());
Log.d("gaolei", "point.getRouteLat()----show-----" + point.getRouteLat());
Log.d("gaolei", "point.getRouteLng()----show-----" + point.getRouteLng());
points.add(latLng);
}
if (points.size() > 2) {
OverlayOptions ooPolyline = new PolylineOptions().width(10)
.color(0xFF36D19D).points(points);
routeBaiduMap.addOverlay(ooPolyline);
RoutePoint startPoint = routePoints.get(0);
LatLng startPosition = new LatLng(startPoint.getRouteLat(), startPoint.getRouteLng());
MapStatus.Builder builder = new MapStatus.Builder();
builder.target(startPosition).zoom(18.0f);
routeBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
RoutePoint endPoint = routePoints.get(routePoints.size() - 1);
LatLng endPosition = new LatLng(endPoint.getRouteLat(), endPoint.getRouteLng());
addOverLayout(startPosition, endPosition);
}
total_time.setText("骑行时长:" + time + "分钟");
total_distance.setText("骑行距离:" + distance + "米");
total_price.setText("余额支付:" + price + "元");
}
示例8: initMap
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
private void initMap() {
mMapView = (MapView) findViewById(R.id.share_map);
mBaiduMap = mMapView.getMap();
// 隐藏logo
View child = mMapView.getChildAt(1);
if (child != null && (child instanceof ImageView || child instanceof ZoomControls)) {
child.setVisibility(View.INVISIBLE);
}
//地图上比例尺
//mMapView.showScaleControl(false);
// 隐藏缩放控件
mMapView.showZoomControls(true);
MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(18f);
mBaiduMap.setMapStatus(msu);
//定位初始化
locationClient = new LocationClient(this);
// 设置定位的相关配置
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
option.setOpenGps(true);
option.setCoorType("bd09ll"); // 设置坐标类型
option.setScanSpan(1000);
locationClient.setLocOption(option);
locationClient.registerLocationListener(new BDLocationListener() {
@Override
public void onReceiveLocation(final BDLocation bdLocation) {
if (bdLocation == null || mMapView == null)
return;
//构造定位数据
MyLocationData locData = new MyLocationData.Builder()
.accuracy(bdLocation.getRadius())
.direction(100).latitude(bdLocation.getLatitude())
.longitude(bdLocation.getLongitude()).build();
mBaiduMap.setMyLocationData(locData);
mMe.setLatitude(bdLocation.getLatitude());
mMe.setLongitude(bdLocation.getLongitude());
mMe.update(new UpdateListener() {
@Override
public void done(BmobException e) {
if (null == e) {
Log.i(TAG, "Me ===>>> Latitude : " + bdLocation.getLatitude() + ", Longitude : " + mLongitude);
}
}
});
// 第一次定位时,将地图位置移动到当前位置
if (firstLocation) {
firstLocation = false;
LatLng xy = new LatLng(bdLocation.getLatitude(),
bdLocation.getLongitude());
MapStatusUpdate status = MapStatusUpdateFactory.newLatLng(xy);
mBaiduMap.animateMapStatus(status);
}
}
});
}
示例9: init
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
private void init() {
mSearch = GeoCoder.newInstance();
mSearch.setOnGetGeoCodeResultListener(this);
mMapView = (MapView) findViewById(R.id.map);
mBaiduMap = mMapView.getMap();
mMapView.showZoomControls(false);
entityName = getImei(getApplicationContext()); //手机Imei值的获取,用来充当实体名
client = new LBSTraceClient(getApplicationContext()); //实例化轨迹服务客户端
trace = new Trace(getApplicationContext(), serviceId, entityName, traceType); //实例化轨迹服务
client.setInterval(gatherInterval, packInterval); //设置位置采集和打包周期
}