summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java3
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngUnwrappedBounds.java247
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java26
-rwxr-xr-xplatform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java11
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java24
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java11
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java5
7 files changed, 303 insertions, 24 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java
index 54788caa40..34ca230090 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java
@@ -8,6 +8,7 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
+import com.mapbox.mapboxsdk.geometry.LatLngUnwrappedBounds;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.Projection;
import com.mapbox.mapboxsdk.maps.UiSettings;
@@ -289,7 +290,7 @@ public final class CameraUpdateFactory {
@Override
public CameraPosition getCameraPosition(@NonNull MapboxMap mapboxMap) {
- return mapboxMap.getCameraForLatLngBounds(bounds, padding);
+ return mapboxMap.getCameraForLatLngBounds(LatLngUnwrappedBounds.from(bounds), padding);
}
@Override
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngUnwrappedBounds.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngUnwrappedBounds.java
new file mode 100644
index 0000000000..d279da0211
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngUnwrappedBounds.java
@@ -0,0 +1,247 @@
+package com.mapbox.mapboxsdk.geometry;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.support.annotation.FloatRange;
+import android.support.annotation.Keep;
+import android.support.annotation.NonNull;
+
+import com.mapbox.mapboxsdk.constants.GeometryConstants;
+
+public class LatLngUnwrappedBounds implements Parcelable {
+
+ @Keep
+ private final double latitudeNorth;
+ @Keep
+ private final double latitudeSouth;
+ @Keep
+ private final double longitudeEast;
+ @Keep
+ private final double longitudeWest;
+
+ /**
+ * Constructs a LatLngUnwrappedBounds from doubles representing a LatLng pair.
+ * <p>
+ * This values of latNorth and latSouth should be in the range of [-90, 90],
+ * see {@link GeometryConstants#MIN_LATITUDE} and {@link GeometryConstants#MAX_LATITUDE},
+ * otherwise IllegalArgumentException will be thrown.
+ * latNorth should be greater or equal latSouth, otherwise IllegalArgumentException will be thrown.
+ * lonEast should be greater or equal lonWest, otherwise IllegalArgumentException will be thrown.
+ * <p>
+ * This method doesn't recalculate most east or most west boundaries.
+ * Note that lonEast and lonWest will NOT be wrapped to be in the range of [-180, 180].
+ */
+ public static LatLngUnwrappedBounds from(
+ @FloatRange(from = GeometryConstants.MIN_LATITUDE, to = GeometryConstants.MAX_LATITUDE) double latNorth,
+ double lonEast,
+ @FloatRange(from = GeometryConstants.MIN_LATITUDE, to = GeometryConstants.MAX_LATITUDE) double latSouth,
+ double lonWest) {
+
+ checkParams(latNorth, lonEast, latSouth, lonWest);
+
+ return new LatLngUnwrappedBounds(latNorth, lonEast, latSouth, lonWest);
+ }
+
+ public static LatLngUnwrappedBounds from(LatLngBounds latLngBounds) {
+
+ if (latLngBounds == null) {
+ return null;
+ }
+
+ if (latLngBounds.getLonEast() < latLngBounds.getLonWest()) {
+ return new LatLngUnwrappedBounds(latLngBounds.getLatNorth(),
+ latLngBounds.getLonEast(),
+ latLngBounds.getLatSouth(),
+ latLngBounds.getLonWest() - GeometryConstants.LONGITUDE_SPAN);
+ }
+
+ return new LatLngUnwrappedBounds(latLngBounds.getLatNorth(),
+ latLngBounds.getLonEast(),
+ latLngBounds.getLatSouth(),
+ latLngBounds.getLonWest());
+ }
+
+ private static void checkParams(
+ @FloatRange(from = GeometryConstants.MIN_LATITUDE, to = GeometryConstants.MAX_LATITUDE) double latNorth,
+ double lonEast,
+ @FloatRange(from = GeometryConstants.MIN_LATITUDE, to = GeometryConstants.MAX_LATITUDE) double latSouth,
+ double lonWest) {
+
+ if (Double.isNaN(latNorth) || Double.isNaN(latSouth)) {
+ throw new IllegalArgumentException("latitude must not be NaN");
+ }
+
+ if (Double.isNaN(lonEast) || Double.isNaN(lonWest)) {
+ throw new IllegalArgumentException("longitude must not be NaN");
+ }
+
+ if (latNorth > GeometryConstants.MAX_LATITUDE || latNorth < GeometryConstants.MIN_LATITUDE
+ || latSouth > GeometryConstants.MAX_LATITUDE || latSouth < GeometryConstants.MIN_LATITUDE) {
+ throw new IllegalArgumentException("latitude must be between -90 and 90");
+ }
+
+ if (latNorth < latSouth) {
+ throw new IllegalArgumentException("latNorth cannot be less than latSouth");
+ }
+
+ if (lonEast < lonWest) {
+ throw new IllegalArgumentException("lonEast cannot be less than lonWest");
+ }
+ }
+
+ /**
+ * Construct a new LatLngUnwrappedBounds based on its corners, given in NESW
+ * order.
+ *
+ * @param northLatitude Northern Latitude
+ * @param eastLongitude Eastern Longitude
+ * @param southLatitude Southern Latitude
+ * @param westLongitude Western Longitude
+ */
+ @Keep
+ LatLngUnwrappedBounds(final double northLatitude, final double eastLongitude,
+ final double southLatitude, final double westLongitude) {
+ this.latitudeNorth = northLatitude;
+ this.longitudeEast = eastLongitude;
+ this.latitudeSouth = southLatitude;
+ this.longitudeWest = westLongitude;
+ }
+
+ /**
+ * Get the north latitude value of this bounds.
+ *
+ * @return double latitude value for north
+ */
+ public double getLatNorth() {
+ return this.latitudeNorth;
+ }
+
+ /**
+ * Get the south latitude value of this bounds.
+ *
+ * @return double latitude value for south
+ */
+ public double getLatSouth() {
+ return this.latitudeSouth;
+ }
+
+ /**
+ * Get the east longitude value of this bounds.
+ *
+ * @return double longitude value for east
+ */
+ public double getLonEast() {
+ return this.longitudeEast;
+ }
+
+ /**
+ * Get the west longitude value of this bounds.
+ *
+ * @return double longitude value for west
+ */
+ public double getLonWest() {
+ return this.longitudeWest;
+ }
+
+ /**
+ * Get the latitude-longitude pair of the south west corner of this bounds.
+ *
+ * @return LatLng of the south west corner
+ */
+ @NonNull
+ public LatLng getSouthWest() {
+ return new LatLng(latitudeSouth, longitudeWest);
+ }
+
+ /**
+ * Get the latitude-longitude paur if the north east corner of this bounds.
+ *
+ * @return LatLng of the north east corner
+ */
+ @NonNull
+ public LatLng getNorthEast() {
+ return new LatLng(latitudeNorth, longitudeEast);
+ }
+
+ /**
+ * Get the latitude-longitude pair of the south east corner of this bounds.
+ *
+ * @return LatLng of the south east corner
+ */
+ @NonNull
+ public LatLng getSouthEast() {
+ return new LatLng(latitudeSouth, longitudeEast);
+ }
+
+ /**
+ * Get the latitude-longitude pair of the north west corner of this bounds.
+ *
+ * @return LatLng of the north west corner
+ */
+ @NonNull
+ public LatLng getNorthWest() {
+ return new LatLng(latitudeNorth, longitudeWest);
+ }
+
+ /**
+ * Inner class responsible for recreating Parcels into objects.
+ */
+ public static final Parcelable.Creator<LatLngUnwrappedBounds> CREATOR =
+ new Parcelable.Creator<LatLngUnwrappedBounds>() {
+ @Override
+ public LatLngUnwrappedBounds createFromParcel(@NonNull final Parcel in) {
+ return readFromParcel(in);
+ }
+
+ @Override
+ public LatLngUnwrappedBounds[] newArray(final int size) {
+ return new LatLngUnwrappedBounds[size];
+ }
+ };
+
+ /**
+ * Returns a hash code value for the object.
+ *
+ * @return the hash code
+ */
+ @Override
+ public int hashCode() {
+ return (int) ((latitudeNorth + 90)
+ + ((latitudeSouth + 90) * 1000)
+ + ((longitudeEast + 180) * 1000000)
+ + ((longitudeWest + 180) * 1000000000));
+ }
+
+ /**
+ * Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
+ *
+ * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
+ */
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ /**
+ * Flatten this object in to a Parcel.
+ *
+ * @param out The Parcel in which the object should be written.
+ * @param flags Additional flags about how the object should be written
+ */
+ @Override
+ public void writeToParcel(@NonNull final Parcel out, final int flags) {
+ out.writeDouble(this.latitudeNorth);
+ out.writeDouble(this.longitudeEast);
+ out.writeDouble(this.latitudeSouth);
+ out.writeDouble(this.longitudeWest);
+ }
+
+ private static LatLngUnwrappedBounds readFromParcel(final Parcel in) {
+ final double northLat = in.readDouble();
+ final double eastLon = in.readDouble();
+ final double southLat = in.readDouble();
+ final double westLon = in.readDouble();
+ return new LatLngUnwrappedBounds(northLat, eastLon, southLat, westLon);
+ }
+
+}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
index 3b4db2e62a..eaee270109 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
@@ -36,6 +36,7 @@ import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
+import com.mapbox.mapboxsdk.geometry.LatLngUnwrappedBounds;
import com.mapbox.mapboxsdk.location.LocationComponent;
import com.mapbox.mapboxsdk.log.Logger;
import com.mapbox.mapboxsdk.offline.OfflineRegionDefinition;
@@ -1244,66 +1245,67 @@ public final class MapboxMap {
/**
* Get a camera position that fits a provided bounds and the current camera tilt and bearing.
*
- * @param latLngBounds the bounds to set the map with
+ * @param latLngUnwrappedBounds the bounds to set the map with
* @return the camera position that fits the bounds
*/
@NonNull
- public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds) {
+ public CameraPosition getCameraForLatLngBounds(@NonNull LatLngUnwrappedBounds latLngUnwrappedBounds) {
// we use current camera tilt value to provide expected transformations as #11993
- return getCameraForLatLngBounds(latLngBounds, new int[] {0, 0, 0, 0});
+ return getCameraForLatLngBounds(latLngUnwrappedBounds, new int[] {0, 0, 0, 0});
}
/**
* Get a camera position that fits a provided bounds and padding and the current camera tilt and bearing.
*
- * @param latLngBounds the bounds to set the map with
+ * @param latLngUnwrappedBounds the bounds to set the map with
* @param padding the padding to apply to the bounds
* @return the camera position that fits the bounds and padding
*/
@NonNull
- public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds,
+ public CameraPosition getCameraForLatLngBounds(@NonNull LatLngUnwrappedBounds latLngUnwrappedBounds,
@NonNull @Size(value = 4) int[] padding) {
// we use current camera tilt/bearing value to provide expected transformations as #11993
- return getCameraForLatLngBounds(latLngBounds, padding, transform.getRawBearing(), transform.getTilt());
+ return getCameraForLatLngBounds(latLngUnwrappedBounds,
+ padding, transform.getRawBearing(), transform.getTilt());
}
/**
* Get a camera position that fits a provided bounds, bearing and tilt.
*
- * @param latLngBounds the bounds to set the map with
+ * @param latLngUnwrappedBounds the bounds to set the map with
* @param bearing the bearing to transform the camera position with
* @param tilt to transform the camera position with
* @return the camera position that fits the bounds and given bearing and tilt
*/
@NonNull
- public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds,
+ public CameraPosition getCameraForLatLngBounds(@NonNull LatLngUnwrappedBounds latLngUnwrappedBounds,
@FloatRange(from = MapboxConstants.MINIMUM_DIRECTION,
to = MapboxConstants.MAXIMUM_DIRECTION) double bearing,
@FloatRange(from = MapboxConstants.MINIMUM_TILT,
to = MapboxConstants.MAXIMUM_TILT) double tilt) {
- return getCameraForLatLngBounds(latLngBounds, new int[] {0, 0, 0, 0}, bearing, tilt);
+ return getCameraForLatLngBounds(latLngUnwrappedBounds, new int[] {0, 0, 0, 0}, bearing, tilt);
}
/**
* Get a camera position that fits a provided bounds, padding, bearing and tilt.
*
- * @param latLngBounds the bounds to set the map with
+ * @param latLngUnwrappedBounds the bounds to set the map with
* @param padding the padding to apply to the bounds
* @param bearing the bearing to transform the camera position with
* @param tilt to transform the camera position with
* @return the camera position that fits the bounds, bearing and tilt
*/
@NonNull
- public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds,
+ public CameraPosition getCameraForLatLngBounds(@NonNull LatLngUnwrappedBounds latLngUnwrappedBounds,
@NonNull @Size(value = 4) int[] padding,
@FloatRange(from = MapboxConstants.MINIMUM_DIRECTION,
to = MapboxConstants.MAXIMUM_DIRECTION) double bearing,
@FloatRange(from = MapboxConstants.MINIMUM_TILT,
to = MapboxConstants.MAXIMUM_TILT) double tilt) {
- return nativeMapView.getCameraForLatLngBounds(latLngBounds, padding, bearing, tilt);
+ return nativeMapView.getCameraForLatLngBounds(latLngUnwrappedBounds, padding, bearing, tilt);
}
/**
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
index 8c929fee63..925d590890 100755
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
@@ -25,6 +25,7 @@ import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.exceptions.CalledFromWorkerThreadException;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
+import com.mapbox.mapboxsdk.geometry.LatLngUnwrappedBounds;
import com.mapbox.mapboxsdk.geometry.ProjectedMeters;
import com.mapbox.mapboxsdk.log.Logger;
import com.mapbox.mapboxsdk.maps.renderer.MapRenderer;
@@ -214,7 +215,7 @@ final class NativeMapView {
if (checkState("setLatLngBounds")) {
return;
}
- nativeSetLatLngBounds(latLngBounds);
+ nativeSetLatLngBounds(LatLngUnwrappedBounds.from(latLngBounds));
}
public void cancelTransitions() {
@@ -267,7 +268,8 @@ final class NativeMapView {
return nativeGetLatLng().wrap();
}
- public CameraPosition getCameraForLatLngBounds(LatLngBounds bounds, int[] padding, double bearing, double tilt) {
+ public CameraPosition getCameraForLatLngBounds(LatLngUnwrappedBounds bounds,
+ int[] padding, double bearing, double tilt) {
if (checkState("getCameraForLatLngBounds")) {
return null;
}
@@ -1024,7 +1026,7 @@ final class NativeMapView {
private native String nativeGetStyleJson();
@Keep
- private native void nativeSetLatLngBounds(LatLngBounds latLngBounds);
+ private native void nativeSetLatLngBounds(LatLngUnwrappedBounds latLngUnwrappedBounds);
@Keep
private native void nativeCancelTransitions();
@@ -1045,7 +1047,8 @@ final class NativeMapView {
@NonNull
@Keep
private native CameraPosition nativeGetCameraForLatLngBounds(
- LatLngBounds latLngBounds, double top, double left, double bottom, double right, double bearing, double tilt);
+ LatLngUnwrappedBounds latLngUnwrappedBounds,
+ double top, double left, double bottom, double right, double bearing, double tilt);
@NonNull
@Keep
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java
index 8649c70acb..8ee3da5118 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java
@@ -7,6 +7,7 @@ import android.support.annotation.Keep;
import android.support.annotation.NonNull;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
+import com.mapbox.mapboxsdk.geometry.LatLngUnwrappedBounds;
/**
* An offline region defined by a style URL, geographic bounding box, zoom range, and
@@ -44,7 +45,7 @@ public class OfflineTilePyramidRegionDefinition implements OfflineRegionDefiniti
@Keep
public OfflineTilePyramidRegionDefinition(
String styleURL, LatLngBounds bounds, double minZoom, double maxZoom, float pixelRatio) {
- // Note: Also used in JNI
+
this.styleURL = styleURL;
this.bounds = bounds;
this.minZoom = minZoom;
@@ -53,6 +54,27 @@ public class OfflineTilePyramidRegionDefinition implements OfflineRegionDefiniti
}
/**
+ * Constructor to create an OfflineTilePyramidDefinition from parameters.
+ *
+ * @param styleURL the style
+ * @param unwrappedBounds the unwrapped bounds
+ * @param minZoom min zoom
+ * @param maxZoom max zoom
+ * @param pixelRatio pixel ratio of the device
+ */
+ @Keep
+ public OfflineTilePyramidRegionDefinition(
+ String styleURL, LatLngUnwrappedBounds unwrappedBounds,
+ double minZoom, double maxZoom, float pixelRatio) {
+
+ // Note: Also used in JNI
+ this(styleURL,
+ LatLngBounds.from(unwrappedBounds.getLatNorth(), unwrappedBounds.getLonEast(),
+ unwrappedBounds.getLatSouth(), unwrappedBounds.getLonWest()),
+ minZoom, maxZoom, pixelRatio);
+ }
+
+ /**
* Constructor to create an OfflineTilePyramidDefinition from a Parcel.
*
* @param parcel the parcel to create the OfflineTilePyramidDefinition from
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
index a1d84f1fd4..5362f3ba86 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
@@ -27,6 +27,7 @@ import com.mapbox.mapboxsdk.attribution.AttributionParser;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.maps.Style;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
+import com.mapbox.mapboxsdk.geometry.LatLngUnwrappedBounds;
import com.mapbox.mapboxsdk.log.Logger;
import com.mapbox.mapboxsdk.maps.TelemetryDefinition;
import com.mapbox.mapboxsdk.storage.FileSource;
@@ -288,7 +289,8 @@ public class MapSnapshotter {
String programCacheDir = FileSource.getInternalCachePath(context);
nativeInitialize(this, fileSource, options.pixelRatio, options.width,
- options.height, options.styleUrl, options.styleJson, options.region, options.cameraPosition,
+ options.height, options.styleUrl, options.styleJson,
+ LatLngUnwrappedBounds.from(options.region), options.cameraPosition,
options.showLogo, programCacheDir, options.localIdeographFontFamily);
}
@@ -339,10 +341,10 @@ public class MapSnapshotter {
/**
* Updates the snapshotter with a new {@link LatLngBounds}
*
- * @param region the region
+ * @param unwrappedRegion the region
*/
@Keep
- public native void setRegion(LatLngBounds region);
+ public native void setRegion(LatLngUnwrappedBounds unwrappedRegion);
/**
* Updates the snapshotter with a new style url
@@ -570,7 +572,8 @@ public class MapSnapshotter {
protected native void nativeInitialize(MapSnapshotter mapSnapshotter,
FileSource fileSource, float pixelRatio,
int width, int height, String styleUrl, String styleJson,
- LatLngBounds region, CameraPosition position,
+ LatLngUnwrappedBounds unwrappedRegion,
+ CameraPosition position,
boolean showLogo, String programCacheDir,
String localIdeographFontFamily);
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java
index b75ccf5a9c..ba68ee694a 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java
@@ -9,6 +9,7 @@ import android.support.annotation.WorkerThread;
import com.mapbox.geojson.Feature;
import com.mapbox.geojson.FeatureCollection;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
+import com.mapbox.mapboxsdk.geometry.LatLngUnwrappedBounds;
import com.mapbox.mapboxsdk.style.expressions.Expression;
import java.lang.ref.WeakReference;
@@ -84,7 +85,7 @@ public class CustomGeometrySource extends Source {
* @param bounds The region in which features should be invalidated at all zoom levels
*/
public void invalidateRegion(LatLngBounds bounds) {
- nativeInvalidateBounds(bounds);
+ nativeInvalidateBounds(LatLngUnwrappedBounds.from(bounds));
}
/**
@@ -140,7 +141,7 @@ public class CustomGeometrySource extends Source {
private native void nativeInvalidateTile(int z, int x, int y);
@Keep
- private native void nativeInvalidateBounds(LatLngBounds bounds);
+ private native void nativeInvalidateBounds(LatLngUnwrappedBounds bounds);
@Override
@Keep