本文整理汇总了Java中com.baidu.mapapi.map.SupportMapFragment类的典型用法代码示例。如果您正苦于以下问题:Java SupportMapFragment类的具体用法?Java SupportMapFragment怎么用?Java SupportMapFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SupportMapFragment类属于com.baidu.mapapi.map包,在下文中一共展示了SupportMapFragment类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initViews
import com.baidu.mapapi.map.SupportMapFragment; //导入依赖的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);
}
示例2: onCreate
import com.baidu.mapapi.map.SupportMapFragment; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
SDKInitializer.initialize(getApplicationContext());
setContentView(R.layout.activity_bus);
this.context = this;
initView();// 省市联动;
initAdapter();// 省市联动;
province.setAdapter(arrayAdapterProvince);
mBaiduMap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.bmapView)).getBaiduMap();
mSearch = PoiSearch.newInstance();
mBusLineSearch = BusLineSearch.newInstance();
initListener();
busLineIDList = new ArrayList<String>();
}
示例3: initView
import com.baidu.mapapi.map.SupportMapFragment; //导入依赖的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);
}
示例4: onCreate
import com.baidu.mapapi.map.SupportMapFragment; //导入依赖的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);
back= (ImageView) findViewById(R.id.iv_back);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mBtnPre.setVisibility(View.INVISIBLE);
mBtnNext.setVisibility(View.INVISIBLE);
mBaiduMap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.bmapView)).getBaiduMap();
mBaiduMap.setOnMapClickListener(this);
mSearch = PoiSearch.newInstance();
mSearch.setOnGetPoiSearchResultListener(this);
mBusLineSearch = BusLineSearch.newInstance();
mBusLineSearch.setOnGetBusLineSearchResultListener(this);
busLineIDList = new ArrayList<String>();
overlay = new BusLineOverlay(mBaiduMap);
mBaiduMap.setOnMarkerClickListener(overlay);
}
示例5: onCreate
import com.baidu.mapapi.map.SupportMapFragment; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragment);
MapStatus ms = new MapStatus.Builder().overlook(-20).zoom(15).build();
BaiduMapOptions bo = new BaiduMapOptions().mapStatus(ms);
map = SupportMapFragment.newInstance(bo);
FragmentManager manager = getSupportFragmentManager();
manager.beginTransaction().add(R.id.map, map, "map_fragment").commit();
}