@@ -699,6 +699,11 @@ void NativeMapView::updateFps() {
|
||||
void NativeMapView::onInvalidate() {
|
||||
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::onInvalidate()");
|
||||
|
||||
if (map.isPaused()) {
|
||||
mbgl::Log::Debug(mbgl::Event::Android, "Not rendering as map is paused");
|
||||
return;
|
||||
}
|
||||
|
||||
const bool dirty = !clean.test_and_set();
|
||||
if (dirty) {
|
||||
float zoomFactor = map.getMaxZoom() - map.getMinZoom() + 1;
|
||||
|
||||
@@ -1009,14 +1009,6 @@ public class MapView extends FrameLayout implements LocationListener {
|
||||
mNativeMapView.resizeFramebuffer(width, height);
|
||||
}
|
||||
|
||||
// Called when we need to redraw the view
|
||||
// This is called before our view is first visible to prevent an initial
|
||||
// flicker (see Android SDK documentation)
|
||||
/*@Override
|
||||
public void surfaceRedrawNeeded(SurfaceHolder holder) {
|
||||
mNativeMapView.update();
|
||||
}*/ // TODO call update somewhere?
|
||||
|
||||
// Not used
|
||||
@Override
|
||||
public void onSurfaceTextureUpdated (SurfaceTexture surface) {
|
||||
@@ -1796,7 +1788,6 @@ public class MapView extends FrameLayout implements LocationListener {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines callback for events OnMapChange
|
||||
*/
|
||||
|
||||
@@ -176,12 +176,14 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
|
||||
mMapView.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
|
||||
mMapView.onStop();
|
||||
}
|
||||
|
||||
@@ -204,6 +206,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
mMapView.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ public:
|
||||
|
||||
// Pauses the render thread. The render thread will stop running but will not be terminated and will not lose state until resumed.
|
||||
void pause();
|
||||
bool isPaused();
|
||||
|
||||
// Resumes a paused render thread
|
||||
void resume();
|
||||
|
||||
@@ -39,6 +39,10 @@ void Map::pause() {
|
||||
}
|
||||
}
|
||||
|
||||
bool Map::isPaused() {
|
||||
return paused;
|
||||
}
|
||||
|
||||
void Map::resume() {
|
||||
data->condResume.notify_all();
|
||||
paused = false;
|
||||
|
||||
Reference in New Issue
Block a user