diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java index 7d2d245f6e..8d82dbf6cf 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java @@ -1,8 +1,10 @@ package com.mapbox.mapboxsdk.testapp.activity.maplayout; +import android.graphics.PointF; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxsdk.maps.MapView; +import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.testapp.R; @@ -12,6 +14,7 @@ import com.mapbox.mapboxsdk.testapp.R; public class SimpleMapActivity extends AppCompatActivity { private MapView mapView; + private MapboxMap mapboxMap; @Override protected void onCreate(Bundle savedInstanceState) { @@ -19,15 +22,22 @@ public class SimpleMapActivity extends AppCompatActivity { setContentView(R.layout.activity_map_simple); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); - mapView.getMapAsync(mapboxMap -> mapboxMap.setStyle( - new Style.Builder().fromUrl(Style.MAPBOX_STREETS) - )); + mapView.getMapAsync(map -> { + mapboxMap = map; + mapboxMap.setStyle( + new Style.Builder().fromUrl(Style.MAPBOX_STREETS) + ); + }); } @Override protected void onStart() { super.onStart(); mapView.onStart(); + if (mapboxMap != null) { + // Regression test for #14394 + mapboxMap.queryRenderedFeatures(new PointF(0,0)); + } } @Override |