From 8e8567a48f8ff7e91f2968d011bd173ec8e9effa Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 29 Apr 2023 01:44:23 -0500 Subject: [PATCH] Updating MapLibre Native to the latest version (2023-04-28) --- ACKNOWLEDGEMENTS.md | 6 +++--- external/mapbox-gl-native | 2 +- external/mapbox-gl-native.cmake | 4 ++-- scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp | 4 +++- scwx-qt/source/scwx/qt/map/radar_product_layer.cpp | 4 +++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md index 30ec5f63..889246f4 100644 --- a/ACKNOWLEDGEMENTS.md +++ b/ACKNOWLEDGEMENTS.md @@ -15,7 +15,7 @@ Supercell Wx uses code from the following dependencies: | [bzip2](https://sourceware.org/bzip2/) | [bzip2 and libbzip2 License v1.0.6](https://spdx.org/licenses/bzip2-1.0.6.html) | | [cmake-conan](https://github.com/conan-io/cmake-conan) | [MIT License](https://spdx.org/licenses/MIT.html) | | [cpr](https://github.com/libcpr/cpr) | [MIT License](https://spdx.org/licenses/MIT.html) | -| [CSS Color Parser](https://github.com/deanm/css-color-parser-js) | [MIT License](https://spdx.org/licenses/MIT.html) | Ported to C++ for MapLibre GL Native | +| [CSS Color Parser](https://github.com/deanm/css-color-parser-js) | [MIT License](https://spdx.org/licenses/MIT.html) | Ported to C++ for MapLibre Native | | [Date](https://github.com/HowardHinnant/date) | [MIT License](https://spdx.org/licenses/MIT.html) | | [Dear ImGui](https://github.com/ocornut/imgui) | [MIT License](https://spdx.org/licenses/MIT.html) | | [FreeType](https://freetype.org/) | [Freetype Project License](https://spdx.org/licenses/FTL.html) | @@ -29,8 +29,8 @@ Supercell Wx uses code from the following dependencies: | [libiconv](https://www.gnu.org/software/libiconv/) | [GNU Lesser General Public License v2.1 or later](https://spdx.org/licenses/LGPL-2.1-or-later.html) | | [libpng](http://libpng.org/pub/png/libpng.html) | [PNG Reference Library version 2](https://spdx.org/licenses/libpng-2.0.html) | | [libxml2](http://xmlsoft.org/) | [MIT License](https://spdx.org/licenses/MIT.html) | -| [MapLibre GL Native](https://maplibre.org/projects/maplibre-native/) | [BSD 2-Clause "Simplified" License](https://spdx.org/licenses/BSD-2-Clause.html) | -| [nunicode](https://bitbucket.org/alekseyt/nunicode/src/master/) | [MIT License](https://spdx.org/licenses/MIT.html) | Modified for MapLibre GL Native | +| [MapLibre Native](https://maplibre.org/projects/maplibre-native/) | [BSD 2-Clause "Simplified" License](https://spdx.org/licenses/BSD-2-Clause.html) | +| [nunicode](https://bitbucket.org/alekseyt/nunicode/src/master/) | [MIT License](https://spdx.org/licenses/MIT.html) | Modified for MapLibre Native | | [OpenSSL](https://www.openssl.org/) | [OpenSSL License](https://spdx.org/licenses/OpenSSL.html) | | [Qt](https://www.qt.io/) | [GNU Lesser General Public License v3.0 only](https://spdx.org/licenses/LGPL-3.0-only.html) | Qt Core, Qt GUI, Qt Network, Qt OpenGL, Qt SQL, Qt SVG, Qt Widgets
Additional Licenses: https://doc.qt.io/qt-6/licenses-used-in-qt.html | | [spdlog](https://github.com/gabime/spdlog) | [MIT License](https://spdx.org/licenses/MIT.html) | diff --git a/external/mapbox-gl-native b/external/mapbox-gl-native index e12c4d6b..4c01b7ef 160000 --- a/external/mapbox-gl-native +++ b/external/mapbox-gl-native @@ -1 +1 @@ -Subproject commit e12c4d6be450a163b38548f72e72f4080fc71dbb +Subproject commit 4c01b7ef1f19964167070c3ea008780b8df72182 diff --git a/external/mapbox-gl-native.cmake b/external/mapbox-gl-native.cmake index 910a6849..c48900c1 100644 --- a/external/mapbox-gl-native.cmake +++ b/external/mapbox-gl-native.cmake @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.20) set(PROJECT_NAME scwx-mbgl) set(gtest_disable_pthreads ON) -set(MBGL_WITH_QT ON) -set(MBGL_QT_WITH_INTERNAL_ICU ON) +set(MLN_WITH_QT ON) +set(MLN_QT_WITH_INTERNAL_ICU ON) add_subdirectory(mapbox-gl-native) find_package(ZLIB) diff --git a/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp b/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp index c15b1f6d..b2c92279 100644 --- a/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp +++ b/scwx-qt/source/scwx/qt/gl/draw/draw_item.cpp @@ -58,12 +58,14 @@ void DrawItem::UseDefaultProjection( static glm::vec2 LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate) { + static constexpr double RAD2DEG_D = 180.0 / M_PI; + double latitude = std::clamp( coordinate.first, -mbgl::util::LATITUDE_MAX, mbgl::util::LATITUDE_MAX); glm::vec2 screen { mbgl::util::LONGITUDE_MAX + coordinate.second, -(mbgl::util::LONGITUDE_MAX - - mbgl::util::RAD2DEG_D * + RAD2DEG_D * std::log(std::tan(M_PI / 4.0 + latitude * M_PI / mbgl::util::DEGREES_MAX)))}; return screen; diff --git a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp index f5310f1e..514b7e5c 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp @@ -359,12 +359,14 @@ void RadarProductLayer::UpdateColorTable() static glm::vec2 LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate) { + static constexpr double RAD2DEG_D = 180.0 / M_PI; + double latitude = std::clamp( coordinate.first, -mbgl::util::LATITUDE_MAX, mbgl::util::LATITUDE_MAX); glm::vec2 screen { mbgl::util::LONGITUDE_MAX + coordinate.second, -(mbgl::util::LONGITUDE_MAX - - mbgl::util::RAD2DEG_D * + RAD2DEG_D * std::log(std::tan(M_PI / 4.0 + latitude * M_PI / mbgl::util::DEGREES_MAX)))}; return screen;