summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-07 14:29:19 +0200
committerSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-08 18:20:55 +0200
commit5e2b6bf636472a4464e6ab3ae0d9d01c68de041b (patch)
treed4a924f2ac4174a034448388fb65b033b801a83d /platform/ios
parentc4115f0539be1834db40b318eb4ebb9e27d1eafb (diff)
downloadqtlocation-mapboxgl-5e2b6bf636472a4464e6ab3ae0d9d01c68de041b.tar.gz
[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.
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/src/MGLMapView.mm11
1 files changed, 9 insertions, 2 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 0c6632f229..59bb1c6666 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -4,6 +4,7 @@
#import <OpenGLES/EAGL.h>
#include <mbgl/map/map.hpp>
+#include <mbgl/map/map_options.hpp>
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/map/camera.hpp>
#include <mbgl/map/mode.hpp>
@@ -472,9 +473,15 @@ public:
auto renderer = std::make_unique<mbgl::Renderer>(*_mbglView, config.scaleFactor, *config.fileSource, *_mbglThreadPool, config.contextMode, config.cacheDir, config.localFontFamilyName);
BOOL enableCrossSourceCollisions = !config.perSourceCollisions;
_rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, *_mbglView);
-
+
+ mbgl::MapOptions mapOptions;
+ mapOptions.withMapMode(mbgl::MapMode::Continuous)
+ .withConstrainMode(mbgl::ConstrainMode::None)
+ .withViewportMode(mbgl::ViewportMode::Default)
+ .withCrossSourceCollisions(enableCrossSourceCollisions);
+
NSAssert(!_mbglMap, @"_mbglMap should be NULL");
- _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, self.size, config.scaleFactor, *[config fileSource], *_mbglThreadPool, mbgl::MapMode::Continuous, mbgl::ConstrainMode::None, mbgl::ViewportMode::Default, enableCrossSourceCollisions);
+ _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, self.size, config.scaleFactor, *[config fileSource], *_mbglThreadPool, mapOptions);
// start paused if in IB
if (_isTargetingInterfaceBuilder || background) {