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

Commit

Permalink
[android] #2805 - Create a target to keep both location values consis…
Browse files Browse the repository at this point in the history
…tent.
  • Loading branch information
zugaldia authored and bleege committed Dec 3, 2015
1 parent 349f47b commit 5024d45
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ protected void onCreate(Bundle savedInstanceState) {
// Target
LatLng dc = new LatLng(38.90252, -77.02291);
LatLng nyc = new LatLng(40.73581, -73.99155);
LatLng target = nyc;

// Set up the map
mMapView = (MapView) findViewById(R.id.tiltMapView);
mMapView.setAccessToken(ApiAccess.getToken(this));
mMapView.setStyleUrl(Style.MAPBOX_STREETS);
mMapView.setCenterCoordinate(dc);
mMapView.setCenterCoordinate(target);
mMapView.setZoomLevel(11);
mMapView.onCreate(savedInstanceState);

Expand All @@ -49,7 +50,7 @@ protected void onCreate(Bundle savedInstanceState) {

// Construct a CameraPosition focusing on target and animate the camera to that position.
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(nyc) // Sets the center of the map to target
.target(target) // Sets the center of the map to target
.zoom(17) // Sets the zoom
.bearing(90) // Sets the orientation of the camera to east
.tilt(30) // Sets the tilt of the camera to 30 degrees
Expand Down

0 comments on commit 5024d45

Please sign in to comment.