答案 0 :(得分:1)
试试这个,
GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
//将纬度和经度传递给方法
setMap(Dlat,Dlng);
private void setMap(double dlat, double dlng) {
LatLng location = new LatLng(dlat, dlng);
CameraPosition INIT = new CameraPosition.Builder().target(location).zoom(15.5F).bearing(300F) // orientation
.tilt(50F) // viewing angle
.build();
// use map to move camera into position
map.moveCamera(CameraUpdateFactory.newCameraPosition(INIT));
// create initial marker
markerOptions = new MarkerOptions().position(location);
map.addMarker(markerOptions);
}