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

Commit

Permalink
[android] #3627 - Setting location and basic content padding from top
Browse files Browse the repository at this point in the history
  • Loading branch information
bleege committed Jan 27, 2016
1 parent 435afd7 commit fa9cbfc
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
import com.mapbox.mapboxsdk.constants.Style;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.utils.ApiAccess;
import com.mapbox.mapboxsdk.views.MapView;

Expand All @@ -32,6 +35,14 @@ protected void onCreate(Bundle savedInstanceState) {
mMapView = (MapView) findViewById(R.id.contentOffsetMapView);
mMapView.setAccessToken(ApiAccess.getToken(this));
mMapView.setStyle(Style.MAPBOX_STREETS);

CameraPosition cameraPosition = new CameraPosition.Builder()
.target(new LatLng(36.15534, -86.77620))
.zoom(12)
.build();

mMapView.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
mMapView.setContentPadding(0, 250, 0, 0);
mMapView.onCreate(savedInstanceState);
}

Expand Down

0 comments on commit fa9cbfc

Please sign in to comment.