maplibre support for Qt6 and MSVC 2019 (#125)
* [qt] Updating CMake project files for Qt6 * [qt] Updating non-test projects for Qt6 and msvc2019 * [qt] Test fixes for Qt6 and msvc2019 * [qt] Link whole test archive for Qt and msvc2019 * [qt] Fixing Qt6 headless backend renderer * [qt] Fixes for test failures * [qt] Expression and style parser test fixes * [qt] Backwards compatibility with Qt5 and Qt6 Minimum version is Qt 5.4 due to use of QOpenGLWidget * [qt] LLVM is no longer required for a Windows build * [msvc] msvc2019 fixes for maplibre * Update test/storage/offline_database.test.cpp Co-authored-by: Tadej Novak <tadej@tano.si> * Vector + const is not standard C++ Co-authored-by: Tadej Novak <tadej@tano.si>
This commit is contained in:
@@ -42,7 +42,7 @@ jni::Local<jni::Object<TileServerOptions>> TileServerOptions::New(jni::JNIEnv& e
|
||||
);
|
||||
}
|
||||
|
||||
jni::Local<jni::Array<jni::Object<DefaultStyle>>> TileServerOptions::NewStyles(jni::JNIEnv& env, const std::vector<const mbgl::util::DefaultStyle> nativeStyles) {
|
||||
jni::Local<jni::Array<jni::Object<DefaultStyle>>> TileServerOptions::NewStyles(jni::JNIEnv& env, const std::vector<mbgl::util::DefaultStyle> &nativeStyles) {
|
||||
|
||||
auto retVal = jni::Array<jni::Object<DefaultStyle>>::New(env, nativeStyles.size());
|
||||
for (auto it = begin(nativeStyles); it != end(nativeStyles); ++it) {
|
||||
@@ -107,7 +107,7 @@ mbgl::TileServerOptions TileServerOptions::getTileServerOptions(jni::JNIEnv& env
|
||||
static auto defaultStyleField = javaClass.GetField<jni::String>(env, "defaultStyle");
|
||||
|
||||
static auto defaultStylesField = javaClass.GetField<jni::Array<jni::Object<DefaultStyle>>>(env, "defaultStyles");
|
||||
std::vector<const mbgl::util::DefaultStyle> defaultStyles = TileServerOptions::getDefaultStyles(env, options.Get(env, defaultStylesField));
|
||||
std::vector<mbgl::util::DefaultStyle> defaultStyles = TileServerOptions::getDefaultStyles(env, options.Get(env, defaultStylesField));
|
||||
|
||||
auto retVal = mbgl::TileServerOptions()
|
||||
.withBaseURL(jni::Make<std::string>(env, options.Get(env, baseURLField)))
|
||||
@@ -151,13 +151,13 @@ mbgl::TileServerOptions TileServerOptions::getTileServerOptions(jni::JNIEnv& env
|
||||
return retVal;
|
||||
}
|
||||
|
||||
std::vector<const mbgl::util::DefaultStyle> TileServerOptions::getDefaultStyles(jni::JNIEnv& env, const jni::Array<jni::Object<DefaultStyle>>& styles_) {
|
||||
std::vector<mbgl::util::DefaultStyle> TileServerOptions::getDefaultStyles(jni::JNIEnv& env, const jni::Array<jni::Object<DefaultStyle>>& styles_) {
|
||||
|
||||
std::size_t length = styles_.Length(env);
|
||||
std::vector<const mbgl::util::DefaultStyle> convertedStyles;
|
||||
std::vector<mbgl::util::DefaultStyle> convertedStyles;
|
||||
//convertedStyles.reserve(length);
|
||||
for (std::size_t i = 0; i < length; i++) {
|
||||
const mbgl::util::DefaultStyle converted = DefaultStyle::getDefaultStyle(env, styles_.Get(env, i));
|
||||
mbgl::util::DefaultStyle converted = DefaultStyle::getDefaultStyle(env, styles_.Get(env, i));
|
||||
convertedStyles.push_back(converted);
|
||||
}
|
||||
|
||||
@@ -175,4 +175,4 @@ void TileServerOptions::registerNative(jni::JNIEnv& env) {
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
} // namespace mbgl
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -27,12 +27,12 @@ public:
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
static jni::Local<jni::Array<jni::Object<DefaultStyle>>> NewStyles(jni::JNIEnv& env, const std::vector<const mbgl::util::DefaultStyle>);
|
||||
static std::vector<const mbgl::util::DefaultStyle> getDefaultStyles(jni::JNIEnv& env, const jni::Array<jni::Object<DefaultStyle>>& styles_);
|
||||
static jni::Local<jni::Array<jni::Object<DefaultStyle>>> NewStyles(jni::JNIEnv& env, const std::vector<mbgl::util::DefaultStyle> &);
|
||||
static std::vector<mbgl::util::DefaultStyle> getDefaultStyles(jni::JNIEnv& env, const jni::Array<jni::Object<DefaultStyle>>& styles_);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace android
|
||||
} // namespace mbgl
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user