/** * Enables or disables fading of the compass when facing north. * * <p>By default this feature is enabled * * @param compassFadeFacingNorth True to enable the fading animation; false to disable it */ public void setCompassFadeFacingNorth(boolean compassFadeFacingNorth) { compassSettings.setFadeFacingNorth(compassFadeFacingNorth); mapView.setCompassFadeFacingNorth(compassFadeFacingNorth); }
/** * Returns whether the compass performs a fading animation out when facing north. * * @return True if the compass will fade, false if it remains visible */ public boolean isCompassFadeWhenFacingNorth() { return compassSettings.isFadeFacingNorth(); }
/** * Returns whether the compass is enabled. * * @return True if the compass is enabled; false if the compass is disabled. */ public boolean isCompassEnabled() { return compassSettings.isEnabled(); }
/** * Sets the gravity of the compass view. Use this to change the corner of the map view that the * compass is displayed in. By default, the compass is in the top right corner. * * @param gravity One of the values from {@link Gravity}. * @see Gravity */ @UiThread public void setCompassGravity(int gravity) { compassSettings.setGravity(gravity); mapView.setCompassGravity(gravity); }
/** * Returns the bottom side margin of CompassView * * @return The bottom margin in pixels */ public int getCompassMarginBottom() { return compassSettings.getMargins()[3]; }
/** * Enables or disables the compass. The compass is an icon on the map that indicates the direction * of north on the map. When a user clicks the compass, the camera orients itself to its default * orientation and fades away shortly after. If disabled, the compass will never be displayed. By * default, the compass is enabled. * * @param compassEnabled True to enable the compass; false to disable the compass. */ public void setCompassEnabled(boolean compassEnabled) { compassSettings.setEnabled(compassEnabled); mapView.setCompassEnabled(compassEnabled); }
/** * Returns the right side margin of CompassView * * @return The right margin in pixels */ public int getCompassMarginRight() { return compassSettings.getMargins()[2]; }
/** * Returns the top side margin of CompassView * * @return The top margin in pixels */ public int getCompassMarginTop() { return compassSettings.getMargins()[1]; }
/** * Returns the left side margin of CompassView * * @return The left margin in pixels */ public int getCompassMarginLeft() { return compassSettings.getMargins()[0]; }
/** * Sets the margins of the compass view. Use this to change the distance of the compass from the * map view edge. * * @param left The left margin in pixels. * @param top The top margin in pixels. * @param right The right margin in pixels. * @param bottom The bottom margin in pixels. */ @UiThread public void setCompassMargins(int left, int top, int right, int bottom) { compassSettings.setMargins(new int[] {left, top, right, bottom}); mapView.setCompassMargins(left, top, right, bottom); }
/** * Returns the gravity value of the CompassView * * @return The gravity */ public int getCompassGravity() { return compassSettings.getGravity(); }