diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/package-info.java index 575d10c56..64ab89507 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/package-info.java @@ -1,4 +1,4 @@ /** - * This package contains classes to add and manage annotations and markers in your map. + * This package contains classes to add and manage annotations on your map. */ package com.mapbox.mapboxsdk.annotations; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java index 0c6b5bebe..c480bdacf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/package-info.java @@ -1,4 +1,4 @@ /** - * This package contains the Camera API which is used to control the user's viewpoint of the map. + * This package contains the Camera API classes which are used to control the user's viewpoint of the map. */ package com.mapbox.mapboxsdk.camera; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/package-info.java index b99119db0..75c712074 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/package-info.java @@ -1,4 +1,4 @@ /** - * This package provides access to several map related constants and bundled styles. + * This package contains multiple map related constants classes. */ package com.mapbox.mapboxsdk.constants; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/package-info.java index d593884ee..3b4c3394c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/package-info.java @@ -1,4 +1,4 @@ /** - * This package contains exceptions thrown in this SDK. + * This package contains map specific exception classes. */ package com.mapbox.mapboxsdk.exceptions; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/package-info.java index bf7dae12a..51d433073 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/package-info.java @@ -1,5 +1,4 @@ /** - * This package contains classes that deal with geometry and map coordinates. Many SDK functions - * accept or return these classes. + * This package contains classes related to geometry and map coordinates. */ package com.mapbox.mapboxsdk.geometry; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/layers/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/layers/package-info.java index fda1a493e..b444050cb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/layers/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/layers/package-info.java @@ -1,4 +1,4 @@ /** - * This package contains classes to add and manage layers in your map. + * This package contains classes to add and manage layers of the map. */ package com.mapbox.mapboxsdk.layers; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/package-info.java index f9e64ca97..543cb6832 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/package-info.java @@ -1,4 +1,4 @@ /** - * This package contains the Location Services API for accessing the location of the device. + * This package contains classes that manages the map Location services. */ package com.mapbox.mapboxsdk.location; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java index 4b5aa0cba..3d103f6f8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java @@ -9,11 +9,10 @@ import android.view.View; import android.view.ViewGroup; import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.constants.MapboxConstants; import com.mapbox.mapboxsdk.utils.ApiAccess; /** - * Fragment wrapper around a {@link MapView}. + * Fragment wrapper around a map view. *

* A Map component in an app. This fragment is the simplest way to place a map in an application. * It's a wrapper around a view of a map to automatically handle the necessary life cycle needs. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index 4130c678d..af8cfed03 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -55,6 +55,7 @@ import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ListView; import android.widget.ZoomButtonsController; + import com.almeros.android.multitouch.gesturedetectors.RotateGestureDetector; import com.almeros.android.multitouch.gesturedetectors.ShoveGestureDetector; import com.almeros.android.multitouch.gesturedetectors.TwoFingerGestureDetector; @@ -64,7 +65,6 @@ import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.InfoWindow; import com.mapbox.mapboxsdk.annotations.Marker; -import com.mapbox.mapboxsdk.annotations.MarkerOptions; import com.mapbox.mapboxsdk.annotations.Polygon; import com.mapbox.mapboxsdk.annotations.Polyline; import com.mapbox.mapboxsdk.camera.CameraPosition; @@ -72,7 +72,6 @@ import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.constants.MapboxConstants; import com.mapbox.mapboxsdk.constants.MyBearingTracking; import com.mapbox.mapboxsdk.constants.MyLocationTracking; -import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.exceptions.IconBitmapChangedException; import com.mapbox.mapboxsdk.exceptions.InvalidAccessTokenException; import com.mapbox.mapboxsdk.exceptions.TelemetryServiceNotConfiguredException; @@ -84,6 +83,7 @@ import com.mapbox.mapboxsdk.maps.widgets.UserLocationView; import com.mapbox.mapboxsdk.telemetry.MapboxEvent; import com.mapbox.mapboxsdk.telemetry.MapboxEventManager; import com.mapbox.mapboxsdk.utils.ApiAccess; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.nio.ByteBuffer; @@ -116,7 +116,7 @@ public class MapView extends FrameLayout { private static final float DIMENSION_SEVEN_DP = 7f; private static final float DIMENSION_TEN_DP = 10f; private static final float DIMENSION_SIXTEEN_DP = 16f; - private static final float DIMENSION_SEVENTYSIX_DP = 76f; + private static final float DIMENSION_SEVENTY_SIX_DP = 76f; private MapboxMap mMapboxMap; private List mIcons; @@ -215,8 +215,10 @@ public class MapView extends FrameLayout { mUserLocationView = (UserLocationView) view.findViewById(R.id.userLocationView); mUserLocationView.setMapboxMap(mMapboxMap); + mCompassView = (CompassView) view.findViewById(R.id.compassView); - mCompassView.setOnClickListener(new CompassView.CompassClickListener(mMapboxMap)); + mCompassView.setMapboxMap(mMapboxMap); + mLogoView = (ImageView) view.findViewById(R.id.logoView); // Setup Attributions control @@ -278,7 +280,7 @@ public class MapView extends FrameLayout { // Attribution uiSettings.setAttributionEnabled(typedArray.getBoolean(R.styleable.MapView_attribution_visibility, true)); uiSettings.setAttributionGravity(typedArray.getInt(R.styleable.MapView_attribution_gravity, Gravity.BOTTOM)); - uiSettings.setAttributionMargins((int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_left, DIMENSION_SEVENTYSIX_DP) * mScreenDensity) + uiSettings.setAttributionMargins((int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_left, DIMENSION_SEVENTY_SIX_DP) * mScreenDensity) , (int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_top, DIMENSION_SEVEN_DP) * mScreenDensity) , (int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_right, DIMENSION_SEVEN_DP) * mScreenDensity) , (int) (typedArray.getDimension(R.styleable.MapView_attribution_margin_bottom, DIMENSION_SEVEN_DP) * mScreenDensity)); @@ -540,11 +542,6 @@ public class MapView extends FrameLayout { // LatLng / CenterCoordinate // - /** - * Gets the current LatLng in the center of the MapView - * - * @return The center in LatLng - */ LatLng getLatLng() { return mNativeMapView.getLatLng(); } @@ -553,22 +550,10 @@ public class MapView extends FrameLayout { // Pitch / Tilt // - /** - * Gets the current Tilt in degrees of the MapView - * - * @return tilt in degrees - */ double getTilt() { return mNativeMapView.getPitch(); } - /** - * Sets the Tilt in degrees of the MapView. - * - * @param pitch New tilt in degrees - * @param duration Animation time in milliseconds. If null then 0 is used, making the animation immediate. - */ - @FloatRange(from = MapboxConstants.MINIMUM_TILT, to = MapboxConstants.MAXIMUM_TILT) void setTilt(Double pitch, @Nullable Long duration) { long actualDuration = 0; if (duration != null) { @@ -581,13 +566,6 @@ public class MapView extends FrameLayout { // Direction // - /** - * Returns the current direction of the map relative to true north. - * - * @return The current direction measured in degrees. - */ - @UiThread - @FloatRange(from = MapboxConstants.MINIMUM_DIRECTION, to = MapboxConstants.MAXIMUM_DIRECTION) double getDirection() { double direction = -mNativeMapView.getBearing(); @@ -601,45 +579,10 @@ public class MapView extends FrameLayout { return direction; } - /** - *

- * Rotates the map to a new heading relative to true north immediately. - *

- * - *

- * The initial heading is 0. - *

- * If you want to animate the change, use {@link MapView#setDirection(double, boolean)}. - * - * @param direction The new heading measured in degrees. - * @see MapView#setDirection(double, boolean) - */ - @UiThread void setDirection(@FloatRange(from = MapboxConstants.MINIMUM_DIRECTION, to = MapboxConstants.MAXIMUM_DIRECTION) double direction) { setDirection(direction, false); } - /** - *

- * Rotates the map to a new heading relative to true north and optionally animates the change. - *

- * - * The initial heading is 0. - * - * @param direction The new heading measured in degrees from true north. - * @param animated If true, animates the change. If false, immediately changes the map. - */ - @UiThread void setDirection(@FloatRange(from = MapboxConstants.MINIMUM_DIRECTION, to = MapboxConstants.MAXIMUM_DIRECTION) double direction, boolean animated) { long duration = animated ? MapboxConstants.ANIMATION_DURATION : 0; mNativeMapView.cancelTransitions(); @@ -647,10 +590,6 @@ public class MapView extends FrameLayout { mNativeMapView.setBearing(-direction, duration); } - /** - * Resets the map heading to true north and animates the change. - */ - @UiThread void resetNorth() { mNativeMapView.cancelTransitions(); mNativeMapView.resetNorth(); @@ -660,38 +599,18 @@ public class MapView extends FrameLayout { // Content padding // - /** - * Return The current content padding left of the map view viewport. - * - * @return The current content padding left - */ int getContentPaddingLeft() { return mContentPaddingLeft; } - /** - * Return The current content padding left of the map view viewport. - * - * @return The current content padding left - */ int getContentPaddingTop() { return mContentPaddingTop; } - /** - * Return The current content padding left of the map view viewport. - * - * @return The current content padding right - */ int getContentPaddingRight() { return mContentPaddingRight; } - /** - * Return The current content padding left of the map view viewport. - * - * @return The current content padding bottom - */ int getContentPaddingBottom() { return mContentPaddingBottom; } @@ -700,77 +619,26 @@ public class MapView extends FrameLayout { // Zoom // - /** - * Returns the current zoom level of the map view. - * - * @return The current zoom. - */ - @UiThread - @FloatRange(from = MapboxConstants.MINIMUM_ZOOM, to = MapboxConstants.MAXIMUM_ZOOM) double getZoom() { return mNativeMapView.getZoom(); } - /** - *

- * Sets the minimum zoom level the map can be displayed at. - *

- * - * @param minZoom The new minimum zoom level. - */ - @UiThread void setMinZoom(@FloatRange(from = MapboxConstants.MINIMUM_ZOOM, to = MapboxConstants.MAXIMUM_ZOOM) double minZoom) { mNativeMapView.setMinZoom(minZoom); } - /** - *

- * Gets the maximum zoom level the map can be displayed at. - *

- * - * @return The minimum zoom level. - */ - @UiThread double getMinZoom() { return mNativeMapView.getMinZoom(); } - /** - *

- * Sets the maximum zoom level the map can be displayed at. - *

- * - * @param maxZoom The new maximum zoom level. - */ - @UiThread void setMaxZoom(@FloatRange(from = MapboxConstants.MINIMUM_ZOOM, to = MapboxConstants.MAXIMUM_ZOOM) double maxZoom) { mNativeMapView.setMaxZoom(maxZoom); } - /** - *

- * Gets the maximum zoom level the map can be displayed at. - *

- * - * @return The maximum zoom level. - */ - @UiThread double getMaxZoom() { return mNativeMapView.getMaxZoom(); } - /** - *

- * Sets whether the zoom controls are enabled. - * If enabled, the zoom controls are a pair of buttons - * (one for zooming in, one for zooming out) that appear on the screen. - * When pressed, they cause the camera to zoom in (or out) by one zoom level. - * If disabled, the zoom controls are not shown. - *

- * By default the zoom controls are enabled if the device is only single touch capable; - * - * @param enabled If true, the zoom controls are enabled. - */ void setZoomControlsEnabled(boolean enabled) { mZoomButtonsController.setVisible(enabled); } @@ -795,81 +663,22 @@ public class MapView extends FrameLayout { // Debug // - /** - * Returns whether the map debug information is currently shown. - * - * @return If true, map debug information is currently shown. - */ - @UiThread boolean isDebugActive() { return mNativeMapView.getDebug(); } - /** - *

- * Changes whether the map debug information is shown. - *

- * The default value is false. - * - * @param debugActive If true, map debug information is shown. - */ - @UiThread void setDebugActive(boolean debugActive) { mNativeMapView.setDebug(debugActive); } - /** - *

- * Cycles through the map debug options. - *

- * The value of {@link MapView#isDebugActive()} reflects whether there are - * any map debug options enabled or disabled. - * - * @see MapView#isDebugActive() - */ - @UiThread void cycleDebugOptions() { mNativeMapView.cycleDebugOptions(); } - // True if map has finished loading the view - private boolean isFullyLoaded() { - return mNativeMapView.isFullyLoaded(); - } - // // Styling // - /** - *

- * Loads a new map style from the specified URL. - *

- * {@code url} can take the following forms: - *