views:

322

answers:

1

Hi,

I want to create a simple Map based application in android ,where i can display my current position.Instead of overlaying a simple Image on the MapView to represent the position, i want to overlay the GLSurfaceView on the MapView. But i don't know how to achieve this. Is there any way to do that?. Please anybody knows the solution help me.

A: 

You need to create the GLSurfaceView and set its EGLConfigChooser like this:

glSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);

then set the format of the holder to translucent

glSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);

and add the GLSurfaceView and the MapView to the Layout

setContentView(glSurfaceView);

addContentView(mapView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

finally in your renderer you'll need to set the clear color so it is transparent

gl.glClearColor(0, 0, 0, 0);

lander16