From 5e2b6bf636472a4464e6ab3ae0d9d01c68de041b Mon Sep 17 00:00:00 2001 From: Sudarsana Babu Nagineni Date: Thu, 7 Mar 2019 14:29:19 +0200 Subject: [core] Add MapOptions to define properties of Map To simplify the Map constructor, introduce MapOptions interface to define the properties that can be set on a Map. --- platform/android/src/native_map_view.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'platform/android/src') diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index d8eba09e9a..2f23f0b7d9 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -79,12 +80,18 @@ NativeMapView::NativeMapView(jni::JNIEnv& _env, // Create a renderer frontend rendererFrontend = std::make_unique(mapRenderer); + // Create Map options + MapOptions options; + options.withMapMode(MapMode::Continuous) + .withConstrainMode(ConstrainMode::HeightOnly) + .withViewportMode(ViewportMode::Default) + .withCrossSourceCollisions(_crossSourceCollisions); + // Create the core map map = std::make_unique(*rendererFrontend, *this, mbgl::Size{ static_cast(width), static_cast(height) }, pixelRatio, - fileSource, *threadPool, MapMode::Continuous, - ConstrainMode::HeightOnly, ViewportMode::Default, _crossSourceCollisions); + fileSource, *threadPool, options); } /** -- cgit v1.2.1