From 24468956fc49ba1495e4dba7363a15b6f07f25e7 Mon Sep 17 00:00:00 2001 From: Michael Muesch Date: Thu, 10 Jan 2019 15:25:19 -0500 Subject: Ability to disable any layer using pre-processing flags. --- platform/darwin/src/MGLStyleLayerManager.mm | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'platform/darwin/src/MGLStyleLayerManager.mm') diff --git a/platform/darwin/src/MGLStyleLayerManager.mm b/platform/darwin/src/MGLStyleLayerManager.mm index a05e24bd9d..c0b72e4451 100644 --- a/platform/darwin/src/MGLStyleLayerManager.mm +++ b/platform/darwin/src/MGLStyleLayerManager.mm @@ -16,16 +16,56 @@ namespace mbgl { LayerManagerDarwin::LayerManagerDarwin() { +#if defined(MBGL_LAYER_FILL_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_FILL_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_LINE_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_LINE_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_CIRCLE_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_CIRCLE_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_SYMBOL_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_SYMBOL_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_RASTER_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_RASTER_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_BACKGROUND_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_BACKGROUND_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_HILLSHADE_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_HILLSHADE_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_FILL_EXTRUSION_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_FILL_EXTRUSION_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_HEATMAP_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_HEATMAP_DISABLE_ALL) addLayerType(std::make_unique()); +#endif +#if defined(MBGL_LAYER_CUSTOM_DISABLE_RUNTIME) + addLayerTypeCoreOnly(std::make_unique()); +#elif !defined(MBGL_LAYER_CUSTOM_DISABLE_ALL) addLayerType(std::make_unique()); +#endif } LayerManagerDarwin::~LayerManagerDarwin() = default; @@ -98,6 +138,10 @@ LayerManager* LayerManager::get() noexcept { return LayerManagerDarwin::get(); } +#if defined(MBGL_LAYER_LINE_DISABLE_ALL) || defined(MBGL_LAYER_SYMBOL_DISABLE_ALL) || defined(MBGL_LAYER_FILL_DISABLE_ALL) +const bool LayerManager::annotationsEnabled = false; +#else const bool LayerManager::annotationsEnabled = true; +#endif } // namespace mbgl -- cgit v1.2.1