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); }
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>(); }
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); }
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); }
@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(); }