Map Replication Follow the current location feature in Android

I want to find out how I can replicate the current location function existing in Maps on Android (and iPhone) using the external Google Maps library. The way this function works in Maps is that when you click a button, it starts panning with your location until you touch (and / or move) the map. Using the following, I was able to get my application to save the current location on the screen, but not save the current location in the center of the screen (it rotates when the location approaches the edge of the screen, while Maps keep it in the center all the time):

butMapCurrentLocation.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        runOnUiThread(new Runnable() {
            public void run() {
                mapController.animateTo(myLocationOverlay.getMyLocation());
            }
        });
    }
});

I also tried setCenter, not animateTo, and they seem to have the same effect.

, , , (, ). Runnable , .cancel, : Android: Runnable?

+3
1

Google Maps v2 .

, . :

  • LocationProviders (, gps), . .
  • , .

1. , 2. Maps v2 api. issue .

MapView ( MapView) dispatchTouchEvent. , / .

+1

All Articles