fix segv... set initial map position when not in config
This commit is contained in:
parent
53636cff30
commit
ab69675d69
@ -179,6 +179,7 @@ public class MapView extends GLSurfaceView {
|
||||
}
|
||||
|
||||
setMapFile("default");
|
||||
|
||||
initMapStartPosition();
|
||||
|
||||
mapActivity.registerMapView(this);
|
||||
@ -204,11 +205,19 @@ public class MapView extends GLSurfaceView {
|
||||
GeoPoint startPoint = getStartPoint();
|
||||
if (startPoint != null) {
|
||||
mMapViewPosition.setMapCenter(startPoint);
|
||||
}
|
||||
Log.d(TAG, "got start");
|
||||
|
||||
Byte startZoomLevel = getStartZoomLevel();
|
||||
if (startZoomLevel != null) {
|
||||
mMapViewPosition.setZoomLevel(startZoomLevel.byteValue());
|
||||
Log.d(TAG, "got zoom");
|
||||
} else
|
||||
mMapViewPosition.setZoomLevel((byte) 2);
|
||||
}
|
||||
else {
|
||||
startPoint = new GeoPoint(0, 0);
|
||||
mMapViewPosition.setMapCenter(startPoint);
|
||||
mMapViewPosition.setZoomLevel((byte) 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -777,8 +777,8 @@ public class MapRenderer implements org.mapsforge.android.IMapRenderer {
|
||||
@Override
|
||||
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
|
||||
|
||||
String ext = GLES20.glGetString(GLES20.GL_EXTENSIONS);
|
||||
Log.d(TAG, "Extensions: " + ext);
|
||||
// String ext = GLES20.glGetString(GLES20.GL_EXTENSIONS);
|
||||
// Log.d(TAG, "Extensions: " + ext);
|
||||
|
||||
shortBuffer = new ShortBuffer[rotateBuffers];
|
||||
|
||||
|
||||
@ -77,9 +77,9 @@ public class GlConfigChooser implements GLSurfaceView.EGLConfigChooser {
|
||||
// configurations are considered to be "better" and returned first.
|
||||
// You need to explicitly filter the data returned by eglChooseConfig!
|
||||
|
||||
for (int i = 0; i < configs.length; ++i) {
|
||||
Log.i(TAG, printConfig(egl, display, configs[i]));
|
||||
}
|
||||
// for (int i = 0; i < configs.length; ++i) {
|
||||
// Log.i(TAG, printConfig(egl, display, configs[i]));
|
||||
// }
|
||||
|
||||
// int index = -1;
|
||||
// for (int i = 0; i < configs.length; ++i) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user