本文整理汇总了Java中com.baidu.mapapi.map.MapView.getMap方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.getMap方法的具体用法?Java MapView.getMap怎么用?Java MapView.getMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.baidu.mapapi.map.MapView
的用法示例。
在下文中一共展示了MapView.getMap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import com.baidu.mapapi.map.MapView; //导入方法依赖的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: initView
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
private void initView() {
client = new LocationClient(getApplicationContext());
client.registerLocationListener(new RunningActivity.MyLocationListener());
rootLayout = (LinearLayout) findViewById(R.id.running_root_layout);
mapView = (MapView) findViewById(R.id.bmapView);
startButton = (CircularProgressButton) findViewById(R.id.cpb_button);
latLngText = (TextView) findViewById(R.id.lat_lng_text);
speedNumber = (TextView) findViewById(R.id.speed_text);
distanceNumber = (ImageNumberDisplayView) findViewById(R.id.distance_text);
stepNumber = (ImageNumberDisplayView) findViewById(R.id.running_step);
energyNumber = (ImageNumberDisplayView) findViewById(R.id.running_energy);
setToolbar(R.id.running_toolbar, true);
timer = (Chronometer) findViewById(R.id.timer);
baiduMap = mapView.getMap();
startButton.setClickable(false);
startButton.setIndeterminateProgressMode(true);
}
示例3: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_location);
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);//获取传感器管理服务
// mCurrentMode = LocationMode.NORMAL;
// 地图初始化
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiduMap = mMapView.getMap();
// 开启定位图层
mBaiduMap.setMyLocationEnabled(true);
// 定位初始化
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true); // 打开gps
option.setCoorType("bd09ll"); // 设置坐标类型
option.setScanSpan(1000);
mLocClient.setLocOption(option);
mLocClient.start();
}
示例4: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的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();
}
});
}
示例5: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_routeplan);
CharSequence titleLable = "路线规划功能";
setTitle(titleLable);
// 初始化地图
mMapView = (MapView) findViewById(R.id.map);
mBaidumap = mMapView.getMap();
mBtnPre = (Button) findViewById(R.id.pre);
mBtnNext = (Button) findViewById(R.id.next);
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
// 地图点击事件处理
mBaidumap.setOnMapClickListener(this);
// 初始化搜索模块,注册事件监听
mSearch = RoutePlanSearch.newInstance();
mSearch.setOnGetRoutePlanResultListener(this);
}
示例6: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
//注意该方法要再setContentView方法之前实现
SDKInitializer.initialize(getApplicationContext());
setContentView(R.layout.activity_location_baidu_map);
//获取地图控件引用
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiduMap = mMapView.getMap();
//普通地图
// mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
//卫星地图
mBaiduMap.setMapType(BaiduMap.MAP_TYPE_SATELLITE);
//空白地图, 基础地图瓦片将不会被渲染。在地图类型中设置为NONE,将不会使用流量下载基础地图瓦片图层。使用场景:与瓦片图层一起使用,节省流量,提升自定义瓦片图下载速度。
// mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NONE);
}
示例7: OnInitUiAndData
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
@Override
protected void OnInitUiAndData() {
super.OnInitUiAndData();
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiduMap = mMapView.getMap();
ll_back_on_mapactivity = (LinearLayout) findViewById(R.id.ll_back_on_mapactivity);
fl_mapactivity = (FrameLayout) findViewById(R.id.fl_mapactivity);
btSearch = (Button) findViewById(R.id.btSearch);
btClear = (Button) findViewById(R.id.btClear);
btLoca = (Button) findViewById(R.id.btLoca);
dialog_show = LayoutInflater.from(this).inflate(R.layout.dialog_show, null);
etFrom = (EditTextWithFrame) dialog_show.findViewById(R.id.etFrom);
etEnd = (EditTextWithFrame) dialog_show.findViewById(R.id.etEnd);
}
示例8: init
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
private void init() {
// TODO 自动生成的方法存根
textView_curCity = (TextView) findViewById(R.id.map_textView_curcity);
layout_store = (LinearLayout) findViewById(R.id.map_layout_store);
mMapView = (MapView) findViewById(R.id.bmapView);
imageView_mylocation = (ImageView) findViewById(R.id.map_imageView_mylocaiton);
textView_curCity.setText(curCity);
mBaiduMap = mMapView.getMap();
layout_store.setOnClickListener(this);
imageView_mylocation.setOnClickListener(this);
list = new ArrayList<StoreData>();
mCluster = new Cluster(this, mBaiduMap, mGridSize, isAverageCenter, mGridSize, mDistance);
}
示例9: initView
import com.baidu.mapapi.map.MapView; //导入方法依赖的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: initViews
import com.baidu.mapapi.map.MapView; //导入方法依赖的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);
}
示例11: initViews
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
@Override
protected void initViews() {
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
//注意该方法要再setContentView方法之前实现
SDKInitializer.initialize(getApplicationContext());
setContentView(R.layout.activity_hospital_map_navigation);
setTitleBack("地图导航");
ibBus = (ImageButton) findViewById(R.id.ib_bus);
ibDriver = (ImageButton) findViewById(R.id.ib_driver);
ibWalk = (ImageButton) findViewById(R.id.ib_walk);
mMapView = (MapView) findViewById(R.id.mv);
mBaiduMap = mMapView.getMap();
initMapCenterPoint();
// initMyLocation();
}
示例12: initMapAndLoc
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
private void initMapAndLoc() {
// 地图初始化
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiduMap = mMapView.getMap();
// 开启定位图层
mBaiduMap.setMyLocationEnabled(true);
// 定位初始化
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true);// 打开gps
option.setCoorType("bd09ll"); // 设置坐标类型
option.setScanSpan(1000);
mLocClient.setLocOption(option);
mLocClient.start();
mBaiduMap
.setMyLocationConfigeration(new MyLocationConfiguration(
mCurrentMode, true, mCurrentMarker));
}
示例13: 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));
}
示例14: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_busline);
CharSequence titleLable = "公交线路查询功能";
setTitle(titleLable);
mBtnPre = (Button) findViewById(R.id.pre);
mBtnNext = (Button) findViewById(R.id.next);
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiduMap = mMapView.getMap();
mBaiduMap.setOnMapClickListener(this);
mSearch = PoiSearch.newInstance();
mSearch.setOnGetPoiSearchResultListener(this);
mBusLineSearch = BusLineSearch.newInstance();
mBusLineSearch.setOnGetBusLineSearchResultListener(this);
busLineIDList = new ArrayList<String>();
bar = (ProgressBar) findViewById(R.id.progressBar);
bar.setVisibility(View.GONE);
}
示例15: onCreate
import com.baidu.mapapi.map.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SDKInitializer.initialize(getApplicationContext());
setContentView(R.layout.activity_main);
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiduMap = mMapView.getMap();
mBaiduMap.setMyLocationEnabled(true);
mBaiduMap.setOnMarkerClickListener(mOnMarkerClickListener);
LatLng centLl = MyUtils.getLlByIntent(getIntent());
MyUtils.initMapCenter(centLl, mBaiduMap);
mBdA = BitmapDescriptorFactory.fromResource(R.drawable.icon_marka);
mMarker = MyUtils.addOverLayToMap(mBdA, centLl, mBaiduMap);
}