summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2018-02-06 13:41:16 +0100
committerTobrun <tobrun@mapbox.com>2018-02-08 14:20:56 +0100
commitaeba621573d77e1ce4f72b1e9b39bde92bf174a2 (patch)
tree8868764edbe7bbf08883f1ab602722ead81267ec
parent7bccc9d69555423218c97aab5b3ff2cf9ed3bd24 (diff)
downloadqtlocation-mapboxgl-aeba621573d77e1ce4f72b1e9b39bde92bf174a2.tar.gz
[android] - programmatically create GlSurfaceView
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java4
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml7
2 files changed, 2 insertions, 9 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
index 4deea90cb5..6db11db49f 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
@@ -292,7 +292,7 @@ public class MapView extends FrameLayout {
addView(textureView, 0);
} else {
- GLSurfaceView glSurfaceView = (GLSurfaceView) findViewById(R.id.surfaceView);
+ GLSurfaceView glSurfaceView = new GLSurfaceView(getContext());
glSurfaceView.setZOrderMediaOverlay(mapboxMapOptions.getRenderSurfaceOnTop());
mapRenderer = new GLSurfaceViewMapRenderer(getContext(), glSurfaceView, options.getLocalIdeographFontFamily()) {
@Override
@@ -302,7 +302,7 @@ public class MapView extends FrameLayout {
}
};
- glSurfaceView.setVisibility(View.VISIBLE);
+ addView(glSurfaceView, 0);
}
nativeMapView = new NativeMapView(this, mapRenderer);
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml
index df7ccaaca9..29ff49f47e 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml
+++ b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <android.opengl.GLSurfaceView
- android:id="@+id/surfaceView"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:contentDescription="@null"
- android:visibility="gone"/>
-
<FrameLayout
android:id="@+id/markerViewContainer"
android:layout_width="match_parent"