本文整理汇总了Java中com.baidu.mapapi.BMapManager类的典型用法代码示例。如果您正苦于以下问题:Java BMapManager类的具体用法?Java BMapManager怎么用?Java BMapManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BMapManager类属于com.baidu.mapapi包,在下文中一共展示了BMapManager类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeSureInitBMapManager
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
private BMapManager makeSureInitBMapManager() {
if (this.bMapManager == null) {
this.bMapManager = new BMapManager(this);
this.bMapManager.init(null);
}
return this.bMapManager;
}
示例2: onCreate
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState)
{
GoogleApplication app = (GoogleApplication) this.getApplication();
if (app.mBMapManager == null)
{
app.mBMapManager = new BMapManager(getApplicationContext());
app.mBMapManager.init(new GoogleApplication.MyGeneralListener());
}
mBMapManager = app.mBMapManager;
mLocationClient = new LocationClient(getApplicationContext());
mLocationClient.registerLocationListener(new BDLocationListenerImpl());
// 默认经纬度为苏州
mLocationData.latitude = SUZHOU_LATITUDE;
mLocationData.longitude = SUZHOU_LONGITUDE;
mStartGeoPoint = new GeoPoint((int) (mLocationData.latitude * 1E6), (int) (mLocationData.longitude * 1E6));
super.onCreate(savedInstanceState);
customActionBar();
setContentView(R.layout.activity_location);// TODO
initView();
initMapView();
initLocationClient();
initMKSearch();
startRequestLocation();
setListener();
mMapController.animateTo(mStartGeoPoint);
}
示例3: onCreate
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setMAP_API_KET(Utils.getMetaValue(getApplication(), "map_api_key"));
mBMapMan = new BMapManager(getApplication());
mBMapMan.init(MAP_API_KET, null);
}
示例4: onCreate
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Must be initialized before setContentView
mBMapMan = new BMapManager(getApplication());
mBMapMan.init(BAIDU_MAPS_KEY, this);
setContentView(R.layout.venue_activity);
initSearchText();
initActionBar();
mMapView = (MapView) findViewById(R.id.mapView);
mMapView.setBuiltInZoomControls(ZOOM_CONTROLS_ENABLED);
MapController mMapController = mMapView.getController();
mMapController.setCenter(DEFAULT_LOCATION_BEIJING);
mMapController.setZoom(DEFAULT_ZOOM_LEVEL);
if (getIntent().getExtras() != null) {
final String shareId = getIntent().getExtras().getString("shareId");
mShare = ReadShare.requestShare(shareId, this);
} else {
mShare = WriteShare.initNewShare();
}
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
mFragment = VenueListFragment.newInstance();
ft.replace(R.id.venueFragmentContainer, mFragment);
ft.commit();
setupLocationClient();
setupLocationManager();
// Tiananmen Square coords
mSearchHelper = new VenueSearchHelper(mFragment, 39.915, 116.404);
}
示例5: initMapManager
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
/**
* 初始化地图管理器,注意:请在试用setContentView前初始化BMapManager对象,否则会报错
*/
private void initMapManager() {
mBMapMan = new BMapManager(getApplication());
if(!mBMapMan.init(AppConfig.BAIDU_API_KEY, new MyGeneralListener())) {
KLog.w(TAG, "BMapManager init faild!");
if(AppConfig.DEBUG) {
SmartToast.showLongToast(this, R.string.hint_init_faild, false);
}
}
}
示例6: BaiduMapManager
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
public BaiduMapManager(Activity activity, BMapManager bMapManager,
Integer defaultZoom, GeoPoint defaultCenterGeoPoint) {
this.initMapView(activity, bMapManager, defaultZoom,
defaultCenterGeoPoint);
}
示例7: getBMapManager
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
public BMapManager getBMapManager() {
return this.makeSureInitBMapManager();
}
示例8: onCreate
import com.baidu.mapapi.BMapManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState){
app = (GateApplication)getApplication();
mk = app.mk;
prefix = app.prefix ;
super.onCreate(savedInstanceState);
app.mBMapMan = new BMapManager(getApplication());
app.mBMapMan.init(mk, null);
getLoc();
setContentView(R.layout.activity_main);
mapView();
addUserOverlay();
// 做Button 监听
Button btnCommit = (Button) findViewById(R.id.CommitButton);
Switch sw = (Switch)findViewById(R.id.swt);
sw.setChecked(isWork());
sw.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
Toast.makeText(MapActivity.this, isChecked + "",
Toast.LENGTH_SHORT).show();
HttpFunc web = new HttpFunc();
String url = prefix + "changeDriver.php?id=" + app.id + "&type=";
if(isChecked == true)
url = url + "1";
else
url = url + "0";
web.execute(url);
}
});
new Thread(new Update()).start();
}