Intent intent = getIntent(); if (intent.hasExtra("x") && intent.hasExtra("y")) { // 当用intent参数时,设置中心点为指定点 Bundle b = intent.getExtras(); LatLng p = new LatLng(b.getDouble("y"), b.getDouble("x")); mMapView = new MapView(this, new BaiduMapOptions().mapStatus(new MapStatus.Builder() .target(p).build())); } else { mMapView = new MapView(this, new BaiduMapOptions()); }
添加回答
举报
0/150
提交
取消