Refactor QMapLibreGL to QMapLibre

This commit is contained in:
Dan Paulat 2024-02-27 23:33:57 -06:00
parent db0d26a4ad
commit 1fd52f771c
55 changed files with 305 additions and 313 deletions

View file

@ -15,13 +15,13 @@ namespace map
static const std::string logPrefix_ = "scwx::qt::map::radar_range_layer";
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
static std::shared_ptr<QMapLibreGL::Feature>
GetRangeCircle(float range, QMapLibreGL::Coordinate center);
static std::shared_ptr<QMapLibre::Feature>
GetRangeCircle(float range, QMapLibre::Coordinate center);
void RadarRangeLayer::Add(std::shared_ptr<QMapLibreGL::Map> map,
float range,
QMapLibreGL::Coordinate center,
const QString& before)
void RadarRangeLayer::Add(std::shared_ptr<QMapLibre::Map> map,
float range,
QMapLibre::Coordinate center,
const QString& before)
{
static const QString layerId = QString::fromStdString(types::GetLayerName(
types::LayerType::Data, types::DataLayer::RadarRange));
@ -37,7 +37,7 @@ void RadarRangeLayer::Add(std::shared_ptr<QMapLibreGL::Map> map,
map->removeSource("rangeCircleSource");
}
std::shared_ptr<QMapLibreGL::Feature> rangeCircle =
std::shared_ptr<QMapLibre::Feature> rangeCircle =
GetRangeCircle(range, center);
map->addSource(
@ -49,19 +49,19 @@ void RadarRangeLayer::Add(std::shared_ptr<QMapLibreGL::Map> map,
map->setPaintProperty(layerId, "line-color", "rgba(128, 128, 128, 128)");
}
void RadarRangeLayer::Update(std::shared_ptr<QMapLibreGL::Map> map,
float range,
QMapLibreGL::Coordinate center)
void RadarRangeLayer::Update(std::shared_ptr<QMapLibre::Map> map,
float range,
QMapLibre::Coordinate center)
{
std::shared_ptr<QMapLibreGL::Feature> rangeCircle =
std::shared_ptr<QMapLibre::Feature> rangeCircle =
GetRangeCircle(range, center);
map->updateSource("rangeCircleSource",
{{"data", QVariant::fromValue(*rangeCircle)}});
}
static std::shared_ptr<QMapLibreGL::Feature>
GetRangeCircle(float range, QMapLibreGL::Coordinate center)
static std::shared_ptr<QMapLibre::Feature>
GetRangeCircle(float range, QMapLibre::Coordinate center)
{
const GeographicLib::Geodesic& geodesic(
util::GeographicLib::DefaultGeodesic());
@ -71,7 +71,7 @@ GetRangeCircle(float range, QMapLibreGL::Coordinate center)
float angle = -angleDeltaH;
QMapLibreGL::Coordinates geometry;
QMapLibre::Coordinates geometry;
for (uint16_t azimuth = 0; azimuth <= 720; ++azimuth)
{
@ -90,11 +90,11 @@ GetRangeCircle(float range, QMapLibreGL::Coordinate center)
angle += angleDelta;
}
std::shared_ptr<QMapLibreGL::Feature> rangeCircle =
std::make_shared<QMapLibreGL::Feature>(
QMapLibreGL::Feature::LineStringType,
std::initializer_list<QMapLibreGL::CoordinatesCollection> {
std::initializer_list<QMapLibreGL::Coordinates> {geometry}});
std::shared_ptr<QMapLibre::Feature> rangeCircle =
std::make_shared<QMapLibre::Feature>(
QMapLibre::Feature::LineStringType,
std::initializer_list<QMapLibre::CoordinatesCollection> {
std::initializer_list<QMapLibre::Coordinates> {geometry}});
return rangeCircle;
}