Code example for UiSettings

Methods: setCompassEnabled

     * Checks if the map is ready (which depends on whether the Google Play services APK is 
     * available. This should be called prior to calling any methods on GoogleMap. 
    private boolean checkReady() { 
        if (mMap == null) {
            Toast.makeText(this, R.string.map_not_ready, Toast.LENGTH_SHORT).show();
            return false; 
        return true; 
    public void setZoomButtonsEnabled(View v) {
        if (!checkReady()) { 
        // Enables/disables the zoom controls (+/- buttons in the bottom right of the map). 
        mUiSettings.setZoomControlsEnabled(((CheckBox) v).isChecked());
    public void setCompassEnabled(View v) {
        if (!checkReady()) {