diff options
-rw-r--r-- | cmake/core-files.cmake | 2 | ||||
-rw-r--r-- | cmake/glfw.cmake | 3 | ||||
-rw-r--r-- | cmake/offline.cmake | 6 | ||||
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 6 | ||||
-rw-r--r-- | platform/default/mbgl/util/default_styles.cpp (renamed from src/mbgl/util/default_styles.cpp) | 0 | ||||
-rw-r--r-- | platform/default/mbgl/util/default_styles.hpp (renamed from include/mbgl/util/default_styles.hpp) | 0 | ||||
-rw-r--r-- | platform/ios/config.cmake | 6 | ||||
-rw-r--r-- | platform/macos/config.cmake | 6 | ||||
-rw-r--r-- | platform/qt/config.cmake | 2 | ||||
-rw-r--r-- | platform/qt/qt.cmake | 2 |
10 files changed, 27 insertions, 6 deletions
diff --git a/cmake/core-files.cmake b/cmake/core-files.cmake index 15dc554782..ee7f786596 100644 --- a/cmake/core-files.cmake +++ b/cmake/core-files.cmake @@ -393,7 +393,6 @@ set(MBGL_CORE_FILES include/mbgl/util/compression.hpp include/mbgl/util/constants.hpp include/mbgl/util/convert.hpp - include/mbgl/util/default_styles.hpp include/mbgl/util/enum.hpp include/mbgl/util/exception.hpp include/mbgl/util/feature.hpp @@ -426,7 +425,6 @@ set(MBGL_CORE_FILES src/mbgl/util/compression.cpp src/mbgl/util/constants.cpp src/mbgl/util/convert.cpp - src/mbgl/util/default_styles.cpp src/mbgl/util/dtoa.cpp src/mbgl/util/dtoa.hpp src/mbgl/util/exclusive.hpp diff --git a/cmake/glfw.cmake b/cmake/glfw.cmake index 56a1335e08..5d810d319e 100644 --- a/cmake/glfw.cmake +++ b/cmake/glfw.cmake @@ -7,6 +7,8 @@ target_sources(mbgl-glfw PRIVATE platform/default/glfw_view.cpp PRIVATE include/mbgl/platform/default/settings_json.hpp PRIVATE platform/default/settings_json.cpp + PRIVATE platform/default/mbgl/util/default_styles.hpp + PRIVATE platform/default/mbgl/util/default_styles.cpp ) target_compile_options(mbgl-glfw @@ -16,6 +18,7 @@ target_compile_options(mbgl-glfw target_include_directories(mbgl-glfw PRIVATE include PRIVATE src # TODO: eliminate + PRIVATE platform/default ) target_link_libraries(mbgl-glfw diff --git a/cmake/offline.cmake b/cmake/offline.cmake index 1dc67f7887..23824e6bdf 100644 --- a/cmake/offline.cmake +++ b/cmake/offline.cmake @@ -2,6 +2,11 @@ add_executable(mbgl-offline bin/offline.cpp ) +target_sources(mbgl-offline + PRIVATE platform/default/mbgl/util/default_styles.hpp + PRIVATE platform/default/mbgl/util/default_styles.cpp +) + target_compile_options(mbgl-offline PRIVATE -fvisibility-inlines-hidden ) @@ -9,6 +14,7 @@ target_compile_options(mbgl-offline target_include_directories(mbgl-offline PRIVATE include PRIVATE src # TODO: eliminate + PRIVATE platform/default ) target_link_libraries(mbgl-offline diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index e63e5e0aa8..2deaf794e8 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -61,7 +61,11 @@ static_assert(mbgl::util::default_styles::currentVersion == MGLStyleDefaultVersi } \ \ + (NSURL *)name##StyleURL##WithVersion:(NSInteger)version { \ - return [NSURL URLWithString:[@"mapbox://styles/mapbox/" #fileName "-v" stringByAppendingFormat:@"%li", (long)version]]; \ + if (mbgl::util::default_styles::currentVersion == version) { \ + return [NSURL URLWithString:@(mbgl::util::default_styles::name.url)]; \ + } else { \ + return [NSURL URLWithString:[@"mapbox://styles/mapbox/" #fileName "-v" stringByAppendingFormat:@"%li", (long)version]]; \ + } \ } MGL_DEFINE_STYLE(streets, streets) diff --git a/src/mbgl/util/default_styles.cpp b/platform/default/mbgl/util/default_styles.cpp index 17cc2f5740..17cc2f5740 100644 --- a/src/mbgl/util/default_styles.cpp +++ b/platform/default/mbgl/util/default_styles.cpp diff --git a/include/mbgl/util/default_styles.hpp b/platform/default/mbgl/util/default_styles.hpp index eb7e034722..eb7e034722 100644 --- a/include/mbgl/util/default_styles.hpp +++ b/platform/default/mbgl/util/default_styles.hpp diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake index 3a574b2818..a24d70fd81 100644 --- a/platform/ios/config.cmake +++ b/platform/ios/config.cmake @@ -18,6 +18,10 @@ macro(mbgl_platform_core) PRIVATE platform/default/local_file_source.cpp PRIVATE platform/default/online_file_source.cpp + # Default styles + PRIVATE platform/default/mbgl/util/default_styles.hpp + PRIVATE platform/default/mbgl/util/default_styles.cpp + # Offline PRIVATE platform/default/mbgl/storage/offline.cpp PRIVATE platform/default/mbgl/storage/offline_database.cpp @@ -62,7 +66,7 @@ macro(mbgl_platform_core) target_include_directories(mbgl-core PUBLIC platform/darwin - PRIVATE platform/default + PUBLIC platform/default ) target_link_libraries(mbgl-core diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index b0f26ab2bb..b608d3b2dd 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -18,6 +18,10 @@ macro(mbgl_platform_core) PRIVATE platform/default/local_file_source.cpp PRIVATE platform/default/online_file_source.cpp + # Default styles + PRIVATE platform/default/mbgl/util/default_styles.hpp + PRIVATE platform/default/mbgl/util/default_styles.cpp + # Offline PRIVATE platform/default/mbgl/storage/offline.cpp PRIVATE platform/default/mbgl/storage/offline_database.cpp @@ -55,7 +59,7 @@ macro(mbgl_platform_core) target_include_directories(mbgl-core PUBLIC platform/darwin - PRIVATE platform/default + PUBLIC platform/default ) target_link_libraries(mbgl-core diff --git a/platform/qt/config.cmake b/platform/qt/config.cmake index ff86a0dee1..80274f5ba1 100644 --- a/platform/qt/config.cmake +++ b/platform/qt/config.cmake @@ -15,7 +15,7 @@ macro(mbgl_platform_core) ) target_include_directories(mbgl-core - PRIVATE platform/default + PUBLIC platform/default PRIVATE platform/qt/include ) diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 648d01f64b..76c1d691d0 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -59,6 +59,8 @@ add_library(qmapboxgl SHARED platform/qt/src/qmapbox.cpp platform/qt/src/qmapboxgl.cpp platform/qt/src/qmapboxgl_p.hpp + platform/default/mbgl/util/default_styles.hpp + platform/default/mbgl/util/default_styles.cpp ) # C++ app |