summaryrefslogtreecommitdiff
path: root/platform/default
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-03-25 17:35:44 +0200
committergalinelle <paolo.angelelli@mapbox.com>2020-04-08 14:00:26 +0300
commit9a55c282fecfdd76b1acdf64cef0ce2ed99472ef (patch)
treed2c412ef6ac4782d28cea66b761deeb5fff10cc3 /platform/default
parent7f53cec17b047a1804952a8da543dc10321e1dae (diff)
downloadqtlocation-mapboxgl-9a55c282fecfdd76b1acdf64cef0ce2ed99472ef.tar.gz
Add LocationIndicatorLayer
New key is "G" in mbgl-glfw, cycling between no puck, centered in the viewport and positioned in Tokyo.
Diffstat (limited to 'platform/default')
-rw-r--r--platform/default/src/mbgl/layermanager/layer_manager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/default/src/mbgl/layermanager/layer_manager.cpp b/platform/default/src/mbgl/layermanager/layer_manager.cpp
index f9e46d78ab..3e822a7b4b 100644
--- a/platform/default/src/mbgl/layermanager/layer_manager.cpp
+++ b/platform/default/src/mbgl/layermanager/layer_manager.cpp
@@ -10,8 +10,10 @@
#include <mbgl/layermanager/heatmap_layer_factory.hpp>
#include <mbgl/layermanager/hillshade_layer_factory.hpp>
#include <mbgl/layermanager/line_layer_factory.hpp>
+#include <mbgl/layermanager/location_indicator_layer_factory.hpp>
#include <mbgl/layermanager/raster_layer_factory.hpp>
#include <mbgl/layermanager/symbol_layer_factory.hpp>
+#include <mbgl/util/logging.hpp>
#include <map>
#include <memory>
@@ -65,6 +67,9 @@ LayerManagerDefault::LayerManagerDefault() {
#if !defined(MBGL_LAYER_CUSTOM_DISABLE_ALL)
addLayerType(std::make_unique<CustomLayerFactory>());
#endif
+#if !defined(MBGL_LAYER_LOCATION_INDICATOR_DISABLE_ALL)
+ addLayerType(std::make_unique<LocationIndicatorLayerFactory>());
+#endif
#endif
}
@@ -72,6 +77,8 @@ void LayerManagerDefault::addLayerType(std::unique_ptr<LayerFactory> factory) {
std::string type{factory->getTypeInfo()->type};
if (!type.empty()) {
typeToFactory.emplace(std::make_pair(std::move(type), factory.get()));
+ } else {
+ Log::Warning(Event::Setup, "Failure adding layer factory. getTypeInfo() returned an empty type string.");
}
factories.emplace_back(std::move(factory));
}