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

Commit

Permalink
[android] #3627 - Added marker to illustrate how this should work
Browse files Browse the repository at this point in the history
  • Loading branch information
bleege committed Jan 27, 2016
1 parent fa9cbfc commit f6c59c9
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.widget.Toast;
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
import com.mapbox.mapboxsdk.constants.Style;
Expand Down Expand Up @@ -36,13 +38,17 @@ protected void onCreate(Bundle savedInstanceState) {
mMapView.setAccessToken(ApiAccess.getToken(this));
mMapView.setStyle(Style.MAPBOX_STREETS);

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

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

mMapView.addMarker(new MarkerOptions().position(nashville).title("Nashville"));

mMapView.setContentPadding(0, 1000, 0, 0);
mMapView.onCreate(savedInstanceState);
}

Expand Down

0 comments on commit f6c59c9

Please sign in to comment.