[android] #2805 - Adding processing of target, zoom, and bearing in animateCamera. Setting default location of TiltActivity to DC for more obvious change.

This commit is contained in:
Brad Leege
2015-12-02 15:29:20 -06:00
parent 8c55bc4a0f
commit 6ffcb7b6f6
3 changed files with 25 additions and 1 deletions

View File

@@ -37,4 +37,20 @@ public final class CameraUpdate {
this.tilt = tilt;
this.zoom = zoom;
}
public float getBearing() {
return bearing;
}
public LatLng getTarget() {
return target;
}
public float getTilt() {
return tilt;
}
public float getZoom() {
return zoom;
}
}

View File

@@ -1115,6 +1115,13 @@ public final class MapView extends FrameLayout {
@UiThread
public final void animateCamera (CameraUpdate update) {
LatLngZoom llz = new LatLngZoom(update.getTarget(), update.getZoom());
setCenterCoordinate(llz);
setBearing(update.getBearing());
// TODO - Set tilt
}
//

View File

@@ -31,13 +31,14 @@ public class TiltActivity extends AppCompatActivity {
}
// Target
LatLng dc = new LatLng(38.90252, -77.02291);
LatLng nyc = new LatLng(40.73581, -73.99155);
// Set up the map
mMapView = (MapView) findViewById(R.id.tiltMapView);
mMapView.setAccessToken(ApiAccess.getToken(this));
mMapView.setStyleUrl(Style.MAPBOX_STREETS);
mMapView.setCenterCoordinate(nyc);
mMapView.setCenterCoordinate(dc);
mMapView.setZoomLevel(11);
mMapView.onCreate(savedInstanceState);