#1940 -Adding menu item controls for compass on / off. Removing location_marker assets from App as they're now only in the SDK.

This commit is contained in:
Brad Leege
2015-08-05 12:25:15 -05:00
parent 6e04804586
commit c84a6fbec9
14 changed files with 11 additions and 0 deletions

View File

@@ -247,6 +247,12 @@ public class MainActivity extends ActionBarActivity {
case R.id.action_markers:
// Toggle markers
toggleMarkers(!mIsMarkersOn);
return true;
case R.id.action_compass:
// Toggle compass
mapView.setCompassEnabled(!mapView.isCompassEnabled());
return true;
default:
return super.onOptionsItemSelected(item);

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -12,4 +12,8 @@
android:icon="@drawable/ic_action_location_searching"
android:title="@string/action_gps"
app:showAsAction="ifRoom" />
<item android:id="@+id/action_compass"
android:icon="@drawable/ic_explore_white_24dp"
android:title="@string/action_compass"
app:showAsAction="ifRoom"/>
</menu>

View File

@@ -4,6 +4,7 @@
<string name="app_name">Mapbox GL</string>
<string name="action_gps">Toggle GPS location</string>
<string name="action_compass">Toggle Compass</string>
<string name="action_debug">Toggle debug mode</string>