Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] #2805 - Adding processing of target, zoom, and bearing in a…
Browse files Browse the repository at this point in the history
…nimateCamera. Setting default location of TiltActivity to DC for more obvious change.
  • Loading branch information
bleege committed Dec 2, 2015
1 parent 48f8bbf commit 556ea6f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,13 @@ public void setScrollEnabled(boolean scrollEnabled) {
@UiThread
public final void animateCamera (CameraUpdate update) {

LatLngZoom llz = new LatLngZoom(update.getTarget(), update.getZoom());
setCenterCoordinate(llz);

setBearing(update.getBearing());

// TODO - Set tilt

}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ protected void onCreate(Bundle savedInstanceState) {
}

// 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);

Expand Down

0 comments on commit 556ea6f

Please sign in to comment.