diff options
author | Tobrun <tobrun@mapbox.com> | 2018-05-25 11:46:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 11:46:04 +0200 |
commit | 7aaf492ef2147afc3efcc081b21df343a6f2cb77 (patch) | |
tree | d99f391eda1cc799ec5687c27162227726545699 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java | |
parent | 7710934ff0a2223ae502f6ddce8080f8cf61c9b7 (diff) | |
download | qtlocation-mapboxgl-7aaf492ef2147afc3efcc081b21df343a6f2cb77.tar.gz |
UI thread checking (#12000)
* [android] - add UI thread checking
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java | 5 |
1 files changed, 5 insertions, 0 deletions
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 21a34f6064..469bfa8f39 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 @@ -49,6 +49,7 @@ public class CustomGeometrySource extends Source { * @param options CustomGeometrySourceOptions. */ public CustomGeometrySource(String id, GeometryTileProvider provider, CustomGeometrySourceOptions options) { + super(); this.provider = provider; executor = Executors.newFixedThreadPool(4); initialize(id, options); @@ -62,6 +63,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) { + checkThread(); nativeInvalidateBounds(bounds); } @@ -74,6 +76,7 @@ public class CustomGeometrySource extends Source { * @param y Tile Y coordinate. */ public void invalidateTile(int zoomLevel, int x, int y) { + checkThread(); nativeInvalidateTile(zoomLevel, x, y); } @@ -88,6 +91,7 @@ public class CustomGeometrySource extends Source { * @param data Feature collection for the tile. */ public void setTileData(int zoomLevel, int x, int y, FeatureCollection data) { + checkThread(); nativeSetTileData(zoomLevel, x, y, data); } @@ -99,6 +103,7 @@ public class CustomGeometrySource extends Source { */ @NonNull public List<Feature> querySourceFeatures(@Nullable Expression filter) { + checkThread(); Feature[] features = querySourceFeatures(filter != null ? filter.toArray() : null); return features != null ? Arrays.asList(features) : new ArrayList<Feature>(); } |