diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2018-09-11 22:11:09 +0200 |
---|---|---|
committer | tobrun <tobrun.van.nuland@gmail.com> | 2018-09-11 22:19:42 +0200 |
commit | 6692bb68d4f7d94751b0e5dfd9f2cd012154dcdf (patch) | |
tree | f35423d046f214686fe3a4489367c6cbe19243f3 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java | |
parent | 6d2fcc4e7f9c33b5f3403c3145a77d14a1b333a1 (diff) | |
download | qtlocation-mapboxgl-upstream/tvn-per-source-collision.tar.gz |
[android] - add binding integration for cross source collisionupstream/tvn-per-source-collision
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java index f48bd92327..203b7511f7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java @@ -82,6 +82,8 @@ public class MapboxMapOptions implements Parcelable { private float pixelRatio; + private boolean crossSourceCollisions = true; + /** * Creates a new MapboxMapOptions object. */ @@ -131,6 +133,7 @@ public class MapboxMapOptions implements Parcelable { localIdeographFontFamily = in.readString(); pixelRatio = in.readFloat(); foregroundLoadColor = in.readInt(); + crossSourceCollisions = in.readByte() != 0; } /** @@ -232,6 +235,9 @@ public class MapboxMapOptions implements Parcelable { mapboxMapOptions.foregroundLoadColor( typedArray.getInt(R.styleable.mapbox_MapView_mapbox_foregroundLoadColor, LIGHT_GRAY) ); + mapboxMapOptions.crossSourceCollisions( + typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_cross_source_collisions, true) + ); } finally { typedArray.recycle(); } @@ -567,6 +573,20 @@ public class MapboxMapOptions implements Parcelable { } /** + * Enable cross source collision, defaults to true. + * <p> + * If set to false, it automatically groups layers based on their source ID. + * </p> + * + * @param crossSourceCollisions true to enable, false to disable + * @return This + */ + public MapboxMapOptions crossSourceCollisions(boolean crossSourceCollisions) { + this.crossSourceCollisions = crossSourceCollisions; + return this; + } + + /** * Set the font family for generating glyphs locally for ideographs in the 'CJK Unified Ideographs' * and 'Hangul Syllables' ranges. * <p> @@ -602,6 +622,14 @@ public class MapboxMapOptions implements Parcelable { return prefetchesTiles; } + /** + * Check whether cross source collisions is enabled. + * + * @return true if enabled + */ + public boolean getCrossSourceCollisions() { + return crossSourceCollisions; + } /** * Set the flag to render the map surface on top of another surface. @@ -945,6 +973,7 @@ public class MapboxMapOptions implements Parcelable { dest.writeString(localIdeographFontFamily); dest.writeFloat(pixelRatio); dest.writeInt(foregroundLoadColor); + dest.writeByte((byte) (crossSourceCollisions ? 1 : 0)); } @Override @@ -1050,6 +1079,10 @@ public class MapboxMapOptions implements Parcelable { return false; } + if (crossSourceCollisions != options.crossSourceCollisions) { + return false; + } + return false; } @@ -1090,6 +1123,7 @@ public class MapboxMapOptions implements Parcelable { result = 31 * result + (zMediaOverlay ? 1 : 0); result = 31 * result + (localIdeographFontFamily != null ? localIdeographFontFamily.hashCode() : 0); result = 31 * result + (int) pixelRatio; + result = 31 * result + (crossSourceCollisions ? 1 : 0); return result; } } |