[map] expose getter for the view used for rendering OpenGL on (#87)
This commit is contained in:
@@ -70,6 +70,8 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
|
||||
private NativeMap nativeMapView;
|
||||
@Nullable
|
||||
private MapboxMap mapboxMap;
|
||||
private View renderView;
|
||||
|
||||
private AttributionClickListener attributionClickListener;
|
||||
private MapboxMapOptions mapboxMapOptions;
|
||||
private MapRenderer mapRenderer;
|
||||
@@ -296,6 +298,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
|
||||
};
|
||||
|
||||
addView(textureView, 0);
|
||||
renderView = textureView;
|
||||
} else {
|
||||
MapboxGLSurfaceView glSurfaceView = new MapboxGLSurfaceView(getContext());
|
||||
glSurfaceView.setZOrderMediaOverlay(mapboxMapOptions.getRenderSurfaceOnTop());
|
||||
@@ -308,6 +311,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
|
||||
};
|
||||
|
||||
addView(glSurfaceView, 0);
|
||||
renderView = glSurfaceView;
|
||||
}
|
||||
|
||||
boolean crossSourceCollisions = mapboxMapOptions.getCrossSourceCollisions();
|
||||
@@ -465,6 +469,20 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
|
||||
return destroyed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the View used for rendering OpenGL.
|
||||
* <p>
|
||||
* The type of the returned view is either a GLSurfaceView or a TextureView.
|
||||
* </p>
|
||||
*
|
||||
* @return the view used for rendering OpenGL
|
||||
*/
|
||||
@NonNull
|
||||
@UiThread
|
||||
public View getRenderView() {
|
||||
return renderView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (!isGestureDetectorInitialized()) {
|
||||
|
||||
Reference in New Issue
Block a user