mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 08:20:05 +00:00
Update MapTiler layer ordering
This commit is contained in:
parent
c77c899040
commit
98ab8904be
2 changed files with 21 additions and 17 deletions
|
|
@ -16,6 +16,8 @@
|
|||
#include <scwx/util/threads.hpp>
|
||||
#include <scwx/util/time.hpp>
|
||||
|
||||
#include <regex>
|
||||
|
||||
#include <backends/imgui_impl_opengl3.h>
|
||||
#include <backends/imgui_impl_qt.hpp>
|
||||
#include <boost/uuid/random_generator.hpp>
|
||||
|
|
@ -619,18 +621,22 @@ void MapWidget::AddLayers()
|
|||
|
||||
std::string before = "ferry";
|
||||
|
||||
for (const QString& layer : p->map_->layerIds())
|
||||
for (const QString& qlayer : p->map_->layerIds())
|
||||
{
|
||||
const std::string layer = qlayer.toStdString();
|
||||
|
||||
// Draw below layers defined in map style
|
||||
auto it = std::find_if(
|
||||
mapStyle.drawBelow_.cbegin(),
|
||||
mapStyle.drawBelow_.cend(),
|
||||
[&layer](const std::string& styleLayer) -> bool
|
||||
{ return layer.startsWith(QString::fromStdString(styleLayer)); });
|
||||
auto it = std::find_if(mapStyle.drawBelow_.cbegin(),
|
||||
mapStyle.drawBelow_.cend(),
|
||||
[&layer](const std::string& styleLayer) -> bool
|
||||
{
|
||||
std::regex re {styleLayer};
|
||||
return std::regex_match(layer, re);
|
||||
});
|
||||
|
||||
if (it != mapStyle.drawBelow_.cend())
|
||||
{
|
||||
before = layer.toStdString();
|
||||
before = layer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue