diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-11-08 16:27:28 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-12-10 16:59:50 +0100 |
commit | 4a15a7db79b22843e2a3fce3101ca67a6fda1820 (patch) | |
tree | 5a17932fa8b97fd70d8c02f0d5a780e1d35986e4 /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/MapboxTestingUtils.kt | |
parent | 1cdbb6e06fd6375f7ab79d0e65d6880770433f0c (diff) | |
download | qtlocation-mapboxgl-4a15a7db79b22843e2a3fce3101ca67a6fda1820.tar.gz |
[android] - decouple style loading from OnMapReady
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/MapboxTestingUtils.kt')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/MapboxTestingUtils.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/MapboxTestingUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/MapboxTestingUtils.kt index b1e31709c5..429f4e7ab1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/MapboxTestingUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/utils/MapboxTestingUtils.kt @@ -15,7 +15,7 @@ import com.mapbox.mapboxsdk.style.layers.Property import com.mapbox.mapboxsdk.style.sources.GeoJsonSource fun MapboxMap.querySourceFeatures(sourceId: String): List<Feature> { - return this.style.getSourceAs<GeoJsonSource>(sourceId)?.querySourceFeatures(null) ?: emptyList() + return this.style!!.getSourceAs<GeoJsonSource>(sourceId)?.querySourceFeatures(null) ?: emptyList() } fun MapboxMap.queryRenderedFeatures(location: Location, layerId: String): List<Feature> { @@ -25,7 +25,7 @@ fun MapboxMap.queryRenderedFeatures(location: Location, layerId: String): List<F } fun MapboxMap.isLayerVisible(layerId: String): Boolean { - return this.style.getLayer(layerId)?.visibility?.value?.equals(Property.VISIBLE)!! + return this.style!!.getLayer(layerId)?.visibility?.value?.equals(Property.VISIBLE)!! } fun MapboxMap.waitForSource(uiController: UiController, sourceId: String) { @@ -99,7 +99,7 @@ class MapboxTestingUtils { fun MapboxMap.addImageFromDrawable(string: String, drawable: Drawable) { val bitmapFromDrawable = getBitmapFromDrawable(drawable) - this.style.addImage(string, bitmapFromDrawable) + this.style!!.addImage(string, bitmapFromDrawable) } private fun getBitmapFromDrawable(drawable: Drawable): Bitmap { |