diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp index f976d7d96..ab3034a18 100644 --- a/android/cpp/native_map_view.cpp +++ b/android/cpp/native_map_view.cpp @@ -80,7 +80,7 @@ void MBGLView::notify_map_change(mbgl::MapChange /* change */, mbgl::timestamp / nativeView.notifyMapChange(); } -NativeMapView::NativeMapView(JNIEnv* env, jobject obj_) : map(view), view(*this) { +NativeMapView::NativeMapView(JNIEnv* env, jobject obj_) : view(*this), map(view) { LOG_VERBOSE("NativeMapView::NativeMapView"); LOG_ASSERT(env != nullptr); diff --git a/include/mbgl/android/native_map_view.hpp b/include/mbgl/android/native_map_view.hpp index e2daab939..dee6a2226 100644 --- a/include/mbgl/android/native_map_view.hpp +++ b/include/mbgl/android/native_map_view.hpp @@ -72,8 +72,8 @@ private: ANativeWindow* window = nullptr; + MBGLView view; // Must be before map mbgl::Map map; - MBGLView view; EGLDisplay display = EGL_NO_DISPLAY; EGLSurface surface = EGL_NO_SURFACE;