[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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user