QMapLibre feature and layer interface updates

This commit is contained in:
Dan Paulat 2024-02-28 00:07:09 -06:00
parent ef83c41c0f
commit 21088a5ace
2 changed files with 6 additions and 7 deletions

View file

@ -401,16 +401,16 @@ AddAlertLayer(std::shared_ptr<QMapLibre::Map> map,
const float opacity = outlineColor[3] / 255.0f; const float opacity = outlineColor[3] / 255.0f;
map->addLayer({{"id", bgLayerId}, {"type", "line"}, {"source", sourceId}}, map->addLayer(
beforeLayer); bgLayerId, {{"type", "line"}, {"source", sourceId}}, beforeLayer);
map->setLayoutProperty(bgLayerId, "line-join", "round"); map->setLayoutProperty(bgLayerId, "line-join", "round");
map->setLayoutProperty(bgLayerId, "line-cap", "round"); map->setLayoutProperty(bgLayerId, "line-cap", "round");
map->setPaintProperty(bgLayerId, "line-color", "rgba(0, 0, 0, 255)"); map->setPaintProperty(bgLayerId, "line-color", "rgba(0, 0, 0, 255)");
map->setPaintProperty(bgLayerId, "line-opacity", QString("%1").arg(opacity)); map->setPaintProperty(bgLayerId, "line-opacity", QString("%1").arg(opacity));
map->setPaintProperty(bgLayerId, "line-width", "5"); map->setPaintProperty(bgLayerId, "line-width", "5");
map->addLayer({{"id", fgLayerId}, {"type", "line"}, {"source", sourceId}}, map->addLayer(
beforeLayer); fgLayerId, {{"type", "line"}, {"source", sourceId}}, beforeLayer);
map->setLayoutProperty(fgLayerId, "line-join", "round"); map->setLayoutProperty(fgLayerId, "line-join", "round");
map->setLayoutProperty(fgLayerId, "line-cap", "round"); map->setLayoutProperty(fgLayerId, "line-cap", "round");
map->setPaintProperty(fgLayerId, map->setPaintProperty(fgLayerId,
@ -431,7 +431,7 @@ CreateFeature(const awips::CodedLocation& codedLocation)
{ {
auto mapboxCoordinates = GetMapboxCoordinates(codedLocation); auto mapboxCoordinates = GetMapboxCoordinates(codedLocation);
return { return QMapLibre::Feature {
QMapLibre::Feature::PolygonType, QMapLibre::Feature::PolygonType,
std::initializer_list<QMapLibre::CoordinatesCollection> { std::initializer_list<QMapLibre::CoordinatesCollection> {
std::initializer_list<QMapLibre::Coordinates> {{mapboxCoordinates}}}}; std::initializer_list<QMapLibre::Coordinates> {{mapboxCoordinates}}}};

View file

@ -44,8 +44,7 @@ void RadarRangeLayer::Add(std::shared_ptr<QMapLibre::Map> map,
"rangeCircleSource", "rangeCircleSource",
{{"type", "geojson"}, {"data", QVariant::fromValue(*rangeCircle)}}); {{"type", "geojson"}, {"data", QVariant::fromValue(*rangeCircle)}});
map->addLayer( map->addLayer(
{{"id", layerId}, {"type", "line"}, {"source", "rangeCircleSource"}}, layerId, {{"type", "line"}, {"source", "rangeCircleSource"}}, before);
before);
map->setPaintProperty(layerId, "line-color", "rgba(128, 128, 128, 128)"); map->setPaintProperty(layerId, "line-color", "rgba(128, 128, 128, 128)");
} }