summaryrefslogtreecommitdiff
path: root/platform/android/src/native_map_view.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/native_map_view.cpp')
-rwxr-xr-xplatform/android/src/native_map_view.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index 3a4e2014ba..e74e4c3bbc 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -13,6 +13,7 @@
#include <jni/jni.hpp>
+#include <mbgl/map/map.hpp>
#include <mbgl/map/map_options.hpp>
#include <mbgl/math/minmax.hpp>
#include <mbgl/util/constants.hpp>
@@ -74,24 +75,22 @@ NativeMapView::NativeMapView(jni::JNIEnv& _env,
return;
}
- // Get native peer for file source
- mbgl::FileSource& fileSource = mbgl::android::FileSource::getDefaultFileSource(_env, jFileSource);
-
// Create a renderer frontend
rendererFrontend = std::make_unique<AndroidRendererFrontend>(mapRenderer);
// Create Map options
MapOptions options;
options.withMapMode(MapMode::Continuous)
+ .withSize(mbgl::Size{ static_cast<uint32_t>(width), static_cast<uint32_t>(height) })
+ .withPixelRatio(pixelRatio)
.withConstrainMode(ConstrainMode::HeightOnly)
.withViewportMode(ViewportMode::Default)
.withCrossSourceCollisions(_crossSourceCollisions);
// Create the core map
- map = std::make_unique<mbgl::Map>(*rendererFrontend, *this,
- mbgl::Size{ static_cast<uint32_t>(width),
- static_cast<uint32_t>(height) }, pixelRatio,
- fileSource, *threadPool, options);
+ map = std::make_unique<mbgl::Map>(
+ *rendererFrontend, *this, *threadPool, options,
+ mbgl::android::FileSource::getSharedResourceOptions(_env, jFileSource));
}
/**