1

Am wroking with google map v2 on android and i set setMyLocationEnabled(true)

but there is no action or anything , it doesn't locate.

here is a part of my code , how can i fix it please :

public class Location extends Activity {
    private GoogleMap mMap;
    GoogleApiClient mGoogleApiClient;

    Marker mMarker;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.location);
        mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
        mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        // mMap.moveCamera( CameraUpdateFactory.newLatLngZoom(new LatLng(36.755113, 3.058781) ,6) );

        CameraUpdate center =
                CameraUpdateFactory.newLatLng(new LatLng(36.755113,
                        3.058781));
        CameraUpdate zoom = CameraUpdateFactory.zoomTo((float) 5.4);

        mMap.moveCamera(center);
        mMap.animateCamera(zoom);
        mMap.setMyLocationEnabled(true);
      ));
    }

        public GoogleMap getMap() {
            return mMap;
        }

        @Override
        public void onStop() {
            super.onStop();
            if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {
                mGoogleApiClient.disconnect();
            }
        }
    }
Laidi Oussama
  • 108
  • 1
  • 12

0 Answers0