#1856 - Setting map style programmatically and setting corresponding menu item checked

This commit is contained in:
Brad Leege
2015-08-07 15:41:49 -05:00
parent bfd039853c
commit 23d88928be
2 changed files with 3 additions and 1 deletions

View File

@@ -112,6 +112,9 @@ public class MainActivity extends AppCompatActivity {
mapView.setOnFpsChangedListener(new MyOnFpsChangedListener());
mapView.addOnMapChangedListener(new MyOnMapChangedListener());
changeMapStyle(getString(R.string.styleURLMapboxStreets));
navigationView.getMenu().findItem(R.id.actionStyleMapboxStreets).setChecked(true);
final GestureDetector gestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
public void onLongPress(final MotionEvent e) {
float x = e.getX();

View File

@@ -52,7 +52,6 @@
android:id="@+id/mainMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
mapbox:styleUrl="asset://styles/mapbox-streets-v7.json"
/>
<TextView