#1940 -Adding menu item controls for compass on / off. Removing location_marker assets from App as they're now only in the SDK.
@@ -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);
|
||||
|
||||
|
After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 622 B |
|
Before Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 918 B |
|
Before Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||