Skip to content

Commit

Permalink
clean onMapReady a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarthel-fr committed Sep 30, 2014
1 parent 240ebd3 commit e82c596
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
Expand All @@ -25,7 +24,6 @@
import com.google.android.gms.maps.UiSettings;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
import com.google.maps.android.PolyUtil;

Expand Down Expand Up @@ -100,20 +98,19 @@ public void onMapReady() {
mGoogleMap = mMapFragment.getMap();
if (mGoogleMap != null) {
// You are good to use the map =)
UiSettings uiSettings = mGoogleMap.getUiSettings();
final UiSettings uiSettings = mGoogleMap.getUiSettings();
uiSettings.setCompassEnabled(false);
uiSettings.setZoomControlsEnabled(false);

// Draw the paths
if (!mDrawing.getEncodedPolylines().isEmpty()) {
final LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
for (String encodedPath : mDrawing.getEncodedPolylines()) {
Polyline path = mGoogleMap.addPolyline(mPathOptions);
List<LatLng> pathPoints = PolyUtil.decode(encodedPath);
final List<LatLng> pathPoints = PolyUtil.decode(encodedPath);
mGoogleMap.addPolyline(mPathOptions).setPoints(pathPoints);
for (LatLng point : pathPoints) {
boundsBuilder.include(point);
}
path.setPoints(PolyUtil.decode(encodedPath));
}
animateCameraToBounds(boundsBuilder.build());
}
Expand Down

0 comments on commit e82c596

Please sign in to comment.