title: Google map in android,display in small size mapview
body: <p>I want to display location in map view &amp; map size should be 200X200.
  I tried loading map in mapview but its not displaying properly after tapping on direction pointer 2 to 3 times its displaying correct map but not moving.</p>
  
  <p><img src="https://i.stack.imgur.com/70z4C.png" alt="map"></p>
  
  <p>But when I use complete size of screen for displaying map without changing any code it's loading correctly.How can i display same iin small view?</p>
  
  <p>map code-</p>
  
  <pre><code>static GoogleMap map;
  private MapView mapView;
  MapsInitializer.initialize(getApplicationContext());
  
          switch (GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()) )
          {
          case ConnectionResult.SUCCESS:
              //Toast.makeText(getActivity(), "SUCCESS", Toast.LENGTH_SHORT).show();
              mapView = (MapView)findViewById(R.id.map);
              mapView.onCreate(savedInstanceState);
              // Gets to GoogleMap from the MapView and does initialization stuff
              if(mapView!=null)
              {
                  map = mapView.getMap();
                  map.getUiSettings().setMyLocationButtonEnabled(false);
                  map.setMyLocationEnabled(true);
                  CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(location, 10);
                  map.animateCamera(cameraUpdate);
                  map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
              }
              break;
          case ConnectionResult.SERVICE_MISSING: 
              //Toast.makeText(getActivity(), "SERVICE MISSING", Toast.LENGTH_SHORT).show();
              break;
          case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED: 
              //Toast.makeText(getActivity(), "UPDATE REQUIRED", Toast.LENGTH_SHORT).show();
              break;
          default: Toast.makeText(getApplicationContext(), GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()), Toast.LENGTH_SHORT).show();
          }
  
          CameraPosition cameraPosition = new CameraPosition.Builder()
          .target(location).zoom(10).bearing(0) // Sets the orientation of the camera to east
          .tilt(70)    // Sets the tilt of the camera to 30 degrees
          .build();    // Creates a CameraPosition from the builder
          map.setBuildingsEnabled(true);
          map.setMyLocationEnabled(true);
          map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
          map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
  </code></pre>
  
  <p><strong>Solution -</strong> 
  Done using fragment -</p>
  
  <p>map_screen.xml </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;fragment
          android:id="@+id/mapfragment"
          android:layout_width="wrap_content"
          android:layout_height="200dp"
          android:layout_alignParentTop="true"
          android:layout_gravity="center_horizontal"
          class="com.google.android.gms.maps.SupportMapFragment" /&gt;
  
      &lt;TextView
          android:id="@+id/reg_office_title"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/mapfragment"
          android:layout_gravity="center_horizontal"
          android:layout_marginLeft="10dp"
          android:layout_marginRight="10dp"
          android:layout_marginTop="5dp"
          android:gravity="center"
          android:text="@string/tata_auto"
          android:textColor="@color/tatablue"
          android:textSize="18sp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>java code -</p>
  
  <pre><code>public class MapFragment extends Fragment {
  
      private View view;
  
      public  GoogleMap map; 
      private Location location;
      private LatLng mAddress1;
      public static boolean inMap=false;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          view= inflater.inflate(R.layout.contact_map, container, false);
          setMapView();
          return view;
      }
  
      private void setMapView(){
          CurrentLocation mCurrentLoc=new CurrentLocation(getActivity());
          location = CurrentLocation.locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
          if (location != null) { 
              mCurrentLoc.onLocationChanged(location);
          } else {
              mCurrentLoc.onLocationChanged(location);
          }
  
          //class="com.google.android.gms.maps.SupportMapFragment"
  
          map = ((SupportMapFragment)getActivity().getSupportFragmentManager().findFragmentById(R.id.mapfragment)).getMap();
  
  
          CameraPosition cameraPosition = new CameraPosition.Builder()
          .target(mAddress1).zoom(8).bearing(0) // Sets the orientation of the camera to east
          .tilt(30)    // Sets the tilt of the camera to 30 degrees
          .build();    // Creates a CameraPosition from the builder
          map.setBuildingsEnabled(true);
          map.setMyLocationEnabled(true);
          map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
          map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
  
  
      }
  }
  </code></pre>
  
  <p>mAddress1 is latitude and longitude of your location.</p>